Commit graph

11258 commits

Author SHA1 Message Date
Nicolas Goaziou bcf6970369 org-element: `org-element-parse-secondary-string' accepts nil argument
* lisp/org-element.el (org-element-parse-secondary-string): Accept nil
  argument as a special case.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/96234>
2015-03-21 09:43:45 +01:00
Nicolas Goaziou e0b19dedb9 ox: Throw an error on unresolved id links
* lisp/ox.el (org-export-get-environment): Properly find file
  associated to id link.
(org-export-resolve-id-link): Throw an error on unresolved id links.

Use `org-id-find' instead of `org-id-find-id-file' as the latter may
returns the file attached to current buffer on search failure.

Reported-by: Jacob Gerlach <jacobgerlach@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96020>
2015-03-17 23:31:49 +01:00
Jacob Gerlach dc08e98885 ox.el: Issue error for unresolved fuzzy link
* lisp/ox.el (org-export-resolve-fuzzy-link): Throw an error instead
  of returning nil when link can't be resolved.

* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Change
  last test from should-not to should-error

In addition to throwing an error, don't store the failed match in the
link cache.

TINYCHANGE
2015-03-17 22:46:05 +01:00
Nicolas Goaziou a886b23476 ox: Throw an error on unresolved coderef
* lisp/ox.el (org-export-resolve-coderef): Throw an error on
  unresolved coderef.

* testing/lisp/test-ox.el (test-org-export/resolve-coderef): Update
  test.
2015-03-17 22:42:45 +01:00
Nicolas Goaziou 22ff8381ed ox: Fix defcustom
* lisp/ox.el (org-export-with-title): Fix :package-information value.
2015-03-17 15:51:30 +01:00
Nicolas Goaziou 16cea3d7b7 ox: Remove comment' special value for org-export-with-creator'
* lisp/ox.el (org-export-with-creator): Change default value.

* lisp/ox-ascii.el (org-ascii-template):
* lisp/ox-beamer.el (org-beamer-template):
* lisp/ox-latex.el (org-latex-template):
* lisp/ox-odt.el (org-odt-template):
* lisp/ox-org.el (org-org-template):
* lisp/ox-texinfo.el (org-texinfo-template): Treat
  `org-export-with-creator' as a boolean.

* testing/lisp/test-ox.el (test-org-export/parse-option-keyword):
  Update test.

* doc/org.texi (Export settings): Update allowed values in
  `org-export-with-creator'.

* etc/ORG-NEWS: Signal change.

Special `comment' value isn't meaningful for all back-ends and is not
implemented in every back-end where it makes sense anyway.

It is possible to add a comment including creator at the end of the
document using a body filter instead.
2015-03-17 15:51:22 +01:00
Rasmus fd8c843692 ox-odt: Fix bugs in metadata generation
* ox-odt.el (org-odt-template): Use empty quotes when keyword and
  description is missing.  Fill the generator field like ox-latex.
2015-03-17 01:13:48 +01:00
Gustav Wikström 8562bd09ec org: Nesting grouptags
* lisp/org.el (org-tags-expand): Nesting grouptags.

  Allowing subtags to be defined as groups themselves.

  : #+TAGS: [ Group : SubOne(1) SubTwo ]
  : #+TAGS: [ SubOne : SubOne1 SubOne2 ]
  : #+TAGS: [ SubTwo : SubTwo1 SubTwo2 ]

  Should be seen as a tree of tags:
  - Group
    - SubOne
      - SubOne1
      - SubOne2
    - SubTwo
      - SubTwo1
      - SubTwo2

  Searching for "Group" should return all tags defined above.
2015-03-16 22:27:38 +01:00
Gustav Wikström 6c6ae990c1 org-agenda: Filtering in the agenda on grouptags
Filtering in the agenda on grouptags filter also subcategories.
Exception if filter is applied with a (double) prefix-argument.

Filtering in the agenda on subcategories does not filter the "above"
levels anymore.

If a grouptag contains a regular expression the regular expression
is also used as a filter.

* lisp/org-agenda.el (org-agenda-filter-by-tag): improved UI and
  refactoring.

  Now uses the argument arg and optional argument exclude instead of
  strip and narrow.  ARG because the argument has multiple purposes
  and makes more sense than strip now.  The term narrowing is changed
  to exclude.

* lisp/org-agenda.el (org-agenda-filter-by-tag-refine): name change in
  argument to match org-agenda-filter-by-tag.

* lisp/org-agenda.el (org-agenda-filter-make-matcher): new optional
  argument EXPAND and refactoring.

* lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): new
  function, previously baked into org-agenda-filter-make-matcher.

* lisp/org-agenda.el (org-agenda-filter-apply): New optional parameter
  EXPAND, used in call to org-agenda-filter-make-matcher.

* lisp/org-agenda.el (org-agenda-reapply-filters): Uses another
  parameter (the new optional one) in call to org-agenda-filter-apply.

* lisp/org-agenda.el (org-agenda-finalize): use of new parameter in
  call to org-agenda-filter-apply.

* lisp/org-agenda.el (org-agenda-redo): Use of new parameter in call
  to org-agenda-filter-apply.
2015-03-16 22:27:34 +01:00
Gustav Wikström ee45258cfe org: Grouptags not unique and can contain regexp
* lisp/org.el (org-tags-expand): Grouptags can have regular expressions as
  "sub-tags".

  The regular expressions in the group must be marked up within { }.
  Example use:

  : #+TAGS: [ Project : {P@.+} ]

  Searching for the tag Project will now list all tags also including
  regular expression matches for P@.+.  Good for example if tags for a
  certain project is tagged with a common project-identifier,
  i.e. P@2014_OrgTags.

* lisp/org.el (org-tag-alist) : New symbols for grouptags when the
  tags in the group don't have to be distinct on a heading.

  Grouptags had to previously be defined with { }.  This syntax is
  already used for exclusive tags and Grouptags need their own,
  non-exclusive syntax.  This behaviour is achieved with [ ].  Note: {
  } can still be used also for Grouptags but then only one of the
  given tags can be used on the headline at the same time.  Example:

  [ group : sub1 sub2 ]

  Grouptags also are not filtered when setting up tags.  This means
  they can exist multiple times in org-tag-alist list.  It will be
  usable if nesting of grouptags is ever to become reality.

  There is a slightly annoying side-effect when setting tags in that a
  tag which is both a part of a grouptag and a grouptag of it's own
  will get multiple key-choices in the selection-UI.

* lisp/org.el (org--setup-process-tags): Adaption for the added syntax
  for non-distinct grouptags.

* lisp/org.el (org-fast-tag-selection): Add support for the added,
  non-unique, grouptag-syntax.  Minor (if ...) to (when ...) refactor.
2015-03-16 22:27:26 +01:00
Rasmus e08dca9690 Merge branch 'maint' 2015-03-15 21:53:13 +01:00
Rasmus 19a7d6864d ox-man: Change dispatcher key to 'M'
* ox-man.el (man): Move man-export to 'M' in the ox dispatcher.

Reported by:  Brice Waegenire <brice.wge@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96071>
2015-03-15 21:50:07 +01:00
Nicolas Goaziou 4d7772c6a4 org-plot: Fix empty cells handling
* lisp/org-plot.el (org-plot/gnuplot-script): Fix empty cells
  handling.

Reported-by: Anders Wirzenius <anders.wirzenius@netikka.fi>
<http://permalink.gmane.org/gmane.emacs.orgmode/96022>
2015-03-15 18:10:43 +01:00
Nicolas Goaziou de7c599669 org-plot: Tiny fixes
* lisp/org-plot.el (org-plot/gnuplot-script, org-plot/gnuplot): Tiny
  fixes.
2015-03-15 18:10:14 +01:00
Nicolas Goaziou 7b450bc7bb Fix `org-delete-property-globally'
* lisp/org.el (org-delete-property-globally): Ignore false positive.
2015-03-15 16:53:58 +01:00
Nicolas Goaziou 84d6ff4ec1 Fix `org-entry-delete' with accumulated properties
* lisp/org.el (org-entry-delete): Remove all occurrences of
  accumulated properties, too.  Return a non-nil value when some
  property was removed.

* testing/lisp/test-org.el (test-org/entry-delete): Add test.
2015-03-15 16:53:42 +01:00
Nicolas Goaziou 8cdb2eef0f Fix `org-find-entry-with-id'
* lisp/org.el (org-find-entry-with-id): Ignore false positive ID
  properties when looking for a specific ID.
2015-03-15 15:49:05 +01:00
Nicolas Goaziou 269b680900 Fix CUSTOM_ID search
* lisp/org.el (org-link-search): Avoid false positives when searching
  CUSTOM_ID property.

* testing/lisp/test-org.el (test-org/custom-id): Add test.
2015-03-15 15:49:05 +01:00
Nicolas Goaziou 7072dba04d Implement `org-find-property'
* lisp/org.el (org-find-property): New function.
* testing/lisp/test-org.el (test-org/find-property): New test.
2015-03-15 15:49:05 +01:00
Rasmus a95e9da223 ox-html: Handle missing title better
* ox-html.el (org-html-template): Only insert title when nonnil.

Empty headings trigger a W3 Validator warning.
2015-03-14 01:34:33 +01:00
Rasmus a566f2865d ox-beamer: Fix hyperref bug
* ox-beamer.el (org-beamer-template): Typeset hyperref as in
  ox-latex.
2015-03-14 00:53:11 +01:00
Rasmus cf4145db02 org.el: Declare org-element-update-syntax
* org.el: Declare org-element-update-syntax.  Required by org-add-link-type.
2015-03-14 00:39:54 +01:00
Nicolas Goaziou ac12984ff6 ob-exp: Use user-error' over error' when applicable
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use `user-error'.
  Also keep lines within 80 characters.
2015-03-13 09:09:18 +01:00
Charles Berry 53c6f68896 ob-exp.el: org-babel-exp-process-buffer reports src block w/o language
* lisp/ob-exp.el (org-babel-exp-process-buffer): Issue an error when a
  src block with no language is processed.

Throw an error with an informative message when trying to export buffer
containing `#+src_block\n'.

Reported-by: XIE Yuheng <xyheme@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95920>
2015-03-11 19:23:33 -07:00
Nicolas Goaziou 1de825df31 Fix CATEGORY property
* doc/org.texi (Special properties): Remove "CATEGORY"

* lisp/org.el (org-special-properties): Remove "CATEGORY".
(org-property-get-allowed-values): Ignore "CATEGORY".
(org-entry-get): Make sure to get CATEGORY value using
`org-entry-properties'.

* testing/lisp/test-org.el (test-org/entry-put): Add test.

"CATEGORY" is not a special property as it can also be set using
a properties drawer.
2015-03-11 17:12:49 +01:00
Matthew Gidden 3d01a0bd19 ox-beamer.el: Update BEAMER_HEADER placement
* lisp/ox-beamer.el (`beamer-header'): Move BEAMER_HEADER injection to
  final part of preamble (after themes, title, etc.).  Allows for
  custom short titles, etc., with #+BEAMER_HEADER:
  \title[Short]{Long}.

* doc/org.texi: Updated BEAMER_HEADER entry with a relevant footnote.

Previously, TITLE, etc., was being injected after BEAMER_HEADER, so
short titles (and related) could not be added.  BEAMER_HEADER now
serves as a final preamble injection point.

TINYCHANGE
2015-03-10 21:20:29 +01:00
Nicolas Goaziou 375c831418 Tiny refactoring
* lisp/org.el (org-timestamp--to-internal-time): New function.
(org-timestamp-format): Use new function.
(org-timestamp-split-range): Fix docstring.
2015-03-08 18:34:09 +01:00
Nicolas Goaziou fab7de5787 ox-ascii: Fix TOC keyword
* lisp/ox-ascii.el (org-ascii--build-toc): Fix TOC keyword.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95843>
2015-03-08 17:47:04 +01:00
Nicolas Goaziou 1219b07039 Revert "org-agenda: Fix small bug"
This reverts commit d92ef95170.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95817>
2015-03-08 01:19:45 +01:00
Nicolas Goaziou 5d19c2c689 org-habit: Add support for "++" and "+" repeater types
* lisp/org-habit.el (org-habit-parse-todo): Add repeater type to
  habit.
(org-habit-repeat-type): New function.
(org-habit-build-graph): Handle "++" and "+" repeater types.

Reported-by: Leo He <leodream2008@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95772>
2015-03-07 19:29:40 +01:00
Nicolas Goaziou 9e3c3ec0b3 Fix LaTeX fragment display from remote documents
* lisp/org.el (org-toggle-latex-fragment): Fix display from remote
  documents by creating images in temporary directory.

Reported-by: Dustin Paluch <dustinpaluch@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95712>
2015-03-07 10:01:27 +01:00
Nicolas Goaziou bf4a645cac org-element: Fix indentation removal with line breaks
* lisp/org-element.el (org-element-line-break-parser): Tiny
  refactoring.
(org-element-normalize-contents): Take into consideration line breaks
when removing common indentation.  Small refactoring.

* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
  Add tests.
2015-03-07 01:58:28 +01:00
Nicolas Goaziou 1362c2d22b Change `org-toggle-latex-fragment' behaviour
* lisp/org.el (org-remove-latex-fragment-image-overlays): Allow to
  limit overlay removal through optional arguments.  Define a new
  return value.
(org-toggle-latex-fragment): Change behaviour.  Update docstring
accordingly.
(org-format-latex): Update docstring.  Remove overlay when LaTeX
fragment is deleted.

* etc/ORG-NEWS: Signal change.

The new behaviour is the following:

  - With a double prefix argument or with a single prefix argument
    when point is before the first headline, toggle overlays in the
    whole buffer;

  - With a single prefix argument, toggle overlays in the current
    subtree;

  - On latex code, toggle overlay at point;

  - Otherwise, toggle overlays in the current section.

Suggested-by: <kuangdash@163.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95492>
2015-03-06 11:15:33 +01:00
Nicolas Goaziou 40ef7af622 org-element: Elements can accept multiple secondary strings
* lisp/org-element.el (org-element-secondary-value-alist): Turn
  secondary properties into a list.
(org-element-secondary-p, org-element-map): Apply changes to variable
above.
2015-03-01 17:03:02 +01:00
Nicolas Richard f8731eaeec org-agenda: Nicer error message when accessing killed buffer
* lisp/org-agenda.el (org-agenda-switch-to): Throw an error if marker
  points to no buffer.
2015-02-28 00:51:35 +01:00
Nicolas Goaziou 18685d9852 org-clock: Fix ignored integer values for `org-clock-into-drawer'
* lisp/org-clock.el (org-clock-into-drawer): Fix ignored integer
  values.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/95504>
2015-02-28 00:43:37 +01:00
Nicolas Goaziou b8921e8c78 Fix void `orgtbl-line-start-regexp' in orgstruct++ mode
* lisp/org.el (org-adaptive-fill-function): Use
  `org-table-line-regexp' instead of `orgtbl-line-start-regexp', which
  may not be defined.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/95500>
2015-02-27 18:25:03 +01:00
Rasmus 8c54b254b1 ox-html: Use upstream MathJax CDN
* ox-html.el (org-html-mathjax-options): Add multlinewidth,
  autonumber, tagindent, font, linebreaks and tagside.  Remove MathML.
  Change default indent to correspond to upstream default.  Change
  default MathJax path to point to upstream CDN.
  (org-html--build-mathjax-config): Remove MathML-related parts.
  (org-html-mathjax-template): Simplifiy template.
* org.texi (@LaTeX{} fragments), (Math formatting in HTML export):
  Reflect change in default CDN.
* ORG-NEWS: Document changes.
2015-02-27 13:57:58 +01:00
Nicolas Goaziou 1c5db20860 ox: Small refactoring
* lisp/ox.el (org-export-collect-footnote-definitions): Small
  refactoring.
2015-02-27 12:06:37 +01:00
Nicolas Goaziou 5738086a6b ox: Small refactoring
* lisp/ox.el (org-export-prune-tree): Small refactoring.
2015-02-27 11:53:24 +01:00
Nicolas Goaziou 80bbf2440a org-element: Fix docstring
* lisp/org-element.el (org-element-set-contents): Fix docstring.
2015-02-27 11:53:00 +01:00
Nicolas Goaziou fc850ce623 ox-odt: Small refactoring
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Small
  refactoring.
2015-02-26 21:39:05 +01:00
Rasmus ac55f280d4 ox-odt: Small fix
* ox-odt.el (org-odt--translate-latex-fragments): Fix small
  bug in cebdec663d.
2015-02-26 16:31:14 +01:00
Rasmus f82dad1237 org.el: More general TeX to MathML convert support
* org.el (org-latex-to-mathml-convert-command): Work with
  other converters than mathtoweb.
  (org-latex-to-mathml-convert-command): Add possibility of
  passing latex-fragment.
* org.texi (Working with @LaTeX{} math snippets): Show LaTeXML config.
2015-02-26 15:49:34 +01:00
Rasmus 398165f5a1 ox-odt: Remove unnecessary space when no date
* ox-odt.el (org-odt-template): Remove unnecessary space in header
  when no date.
2015-02-26 15:49:34 +01:00
Nicolas Goaziou ce7b3fc74b ox-odt: Small fix
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Fix bug
  introduced in cebdec663d.
2015-02-26 15:45:24 +01:00
Nicolas Goaziou cebdec663d ox-odt: Preserve white space when converting LaTeX code
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Preserve white
  space when converting LaTeX code.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95472>
2015-02-26 15:41:35 +01:00
Nicolas Goaziou f8edfc9fb3 org-macs: Fix `org-string-nw-p'
* lisp/org-macs.el (org-string-nw-p): Return value doesn't depend
  anymore on the current syntax table.

Reported-by: Rasmus Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95467>
2015-02-26 15:14:40 +01:00
Nicolas Goaziou c1da4d01a9 Small fix
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Return a non-nil
  value in any case.  This fixes
  37d2a2d1cf.
2015-02-26 09:06:13 +01:00
Nicolas Goaziou 37d2a2d1cf Prevent invisible characters in keywords
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Forbid invisible
  characters (e.g. bracket links) in all keywords but TITLE, DATE,
  AUTHOR, CAPTION and EMAIL.  Also remove back-end specific keywords,
  which are treated just like any other regular keyword.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95415>
2015-02-26 00:21:53 +01:00
Nicolas Goaziou 50a0e712cc ox-odt: Fix handling math snippets in captions
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Fix handling
  math snippets in captions.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95446>
2015-02-25 23:45:15 +01:00
Nicolas Goaziou 1493151b3f ob-core: Improper lists are returned in fixed-width areas
* lisp/ob-core.el (org-babel-insert-result): Improper lists are
  removeable.

When a list cannot be turned into a table, return it in a fixed-width
area so that it can be removed.

Suggested-by: Charles C. Berry <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/95430>
2015-02-25 14:41:13 +01:00
Nicolas Goaziou c76f254e8b ox: Fix custom link handling in anonymous back-end
* lisp/ox.el (org-export-custom-protocol-maybe): Change signature.
* contrib/lisp/ox-groff.el (org-groff-link):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link): Apply signature change.

* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe):
  Update test.

Provide explicitly back-end used instead of guessing it from INFO
channel as an anonymous back-end could be used, masquerading the real
one.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95402>
2015-02-24 15:54:01 +01:00
Nicolas Goaziou ad7b7efcdc ob-core: Fix inserting improper lists
* lisp/ob-core.el (org-babel-insert-result): Fix output when result is
  an improper list, which cannot be turned into a table.

* testing/lisp/test-ob.el (test-ob/org-babel-insert-result--improper-lists):
  New test.

Reported-by: Daniele Pizzolli <dan@toel.it>
<http://permalink.gmane.org/gmane.emacs.orgmode/95348>
2015-02-23 18:44:52 +01:00
Nicolas Goaziou e4da74c452 org-habit: Fix 6652baa39d
* lisp/org-habit.el (org-habit-parse-todo): Fix regexp introduced in
  6652baa39d.
2015-02-22 17:26:21 +01:00
Nicolas Goaziou 6652baa39d org-habit: Small refactoring
* lisp/org-habit.el (org-habit-parse-todo): Small refactoring.
2015-02-22 17:12:56 +01:00
Nicolas Goaziou 4eb4f47141 Simplify `org-show-context' configuration
* lisp/org.el (org-show-context-detail): New variable.
(org-context-choice, org-show-following-heading, org-show-siblings,
org-show-entry-below, org-show-hierarchy-above): Remove variables.
(org-show-set-visibility): New function.
(org-convert-to-oddeven-levels, org-get-location, org-show-context,
org-reveal): Use new function.
(org-link-search): Update docstring.

* lisp/org-agenda.el (org-agenda-cycle-show): Use new function.
(org-agenda-show): Replace missing variable.

* testing/lisp/test-org.el (test-org/show-set-visibility): New test.

* doc/org.texi (Sparse trees):
* doc/orgguide.texi (Sparse trees): Document changes.

* etc/ORG-NEWS: Signal changes.

Configuration of `org-show-context' is done with a single variable
offering six different views, instead of four variables for a total
of 16 configurations.
2015-02-22 14:57:09 +01:00
Nicolas Goaziou 1ba7d23c52 Small fix
* lisp/org.el (org-mode-flyspell-verify): Small fix.
2015-02-22 11:41:01 +01:00
Nicolas Goaziou fa145361ec ox: Allow to narrow scope in footnotes API
* lisp/ox.el (org-export--footnote-reference-map,
  org-export-collect-footnote-definitions,
  org-export-footnote-first-reference-p,
  org-export-get-footnote-number): Allow to specify scope, through
  a new optional argument.

* lisp/ox-odt.el (org-odt-footnote-reference): Apply API change.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p,
  test-org-export/get-footnote-number,
  test-org-export/collect-footnote-definitions): Update tests.
2015-02-21 11:29:40 +01:00
Nicolas Goaziou 719dda85ea ox: Small refactoring
* lisp/ox.el (org-export-document-properties): New variable.
(org-export-prune-tree, org-export-remove-uninterpreted-data): Use new variable.
2015-02-20 18:50:27 +01:00
Nicolas Goaziou 014de0a532 ox: Change `org-export-collect-footnote-definitions' signature
* lisp/ox.el (org-export-collect-footnote-definitions): Refactor
  code.  Change signature.

* testing/lisp/test-ox.el (test-org-export/collect-footnote-definitions):
  New test.
(test-org-export/footnotes): Update test.

* lisp/ox-ascii.el (org-ascii-inner-template):
* lisp/ox-html.el (org-html-footnote-section): Apply signature change.

* etc/ORG-NEWS: Document signature change.

This change makes `org-export-collect-footnote-definitions' compatible
with `org-export-get-footnote-number' and
`org-export-footnote-first-reference-p'.
2015-02-20 18:06:23 +01:00
Nicolas Goaziou 21c6a1e1e9 org-habit: Update copyright year 2015-02-20 16:25:08 +01:00
Nicolas Goaziou de51e1aef6 org-habit: Extend tracking to done notes
* lisp/org-habit.el (org-habit-parse-todo): Also find timestamps when
  `org-log-done' is `note'.

Reported-by: Andrew Francis Swann <swann@math.au.dk>
2015-02-20 10:45:59 +01:00
Rasmus 1616e08448 org.el: Backwards compatibility
* org.el (org-cdlatex-environment-indent): Remove cl-prefixes for
  compatibility.
2015-02-20 01:35:34 +01:00
Rasmus 507d2aae0f Fix bug introduced in 438d75c
* ox-latex.el (org-latex--format-spec): Fix bug.
2015-02-20 00:05:56 +01:00
Rasmus 438d75c59d ox-latex: Format-spec for hyperref and title
* ox-latex.el (org-latex--format-spec): New function with format-specs.
  (org-latex-template): Use org-latex--format-spec.
  (org-latex-hyperref-template): New defaults and use
  org-latex--format-spec.
  (org-latex-title-command): Use org-latex--format-spec.
* ORG-NEWS: Mention change.
2015-02-19 22:41:02 +01:00
Rasmus 14a9510ce1 org.el: Change indention for cdlatex environments
* org.el (org-cdlatex-environment-indent): Use different indent
  algorithm based on content above the new latex-environment.
2015-02-19 22:40:51 +01:00
Nicolas Goaziou 38ab8b2af3 Fix `org-time-stamp'
* lisp/org.el (org-time-stamp): Properly insert time when specified.

This fixes e50baa4cf7.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95210>
2015-02-19 10:33:26 +01:00
Nicolas Goaziou 7745ef04c9 ob-core: Allow spaces in NAME
* lisp/ob-core.el (org-babel-src-name-w-name-regexp): Allow spaces as
  NAME value.

Suggested-by: Joost Helberg <joost@snow.nl>
<http://permalink.gmane.org/gmane.emacs.orgmode/95175>
2015-02-18 15:02:22 +01:00
Nicolas Goaziou 5894a74500 org-src: Update copyright year 2015-02-18 14:58:36 +01:00
Nicolas Goaziou a5f1a3e4be org-src: Small refactoring
* lisp/org-src.el (org-src--remove-overlay): New function.
(org-src--edit-element, org-src-mode-configure-edit-buffer): Use new
function.
2015-02-18 02:05:57 +01:00
Nicolas Goaziou 2dd548a4e0 Merge branch 'maint' 2015-02-18 02:04:39 +01:00
Nicolas Goaziou c41bbc577e Fix "Wrong type argument: overlayp"
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Fix "Wrong
  type argument: overlayp".

Changing major mode in a source edit buffer resets local variables
used to link it to source buffer.  As a consequence, overlay in source
buffer can no longer be found nor deleted.
2015-02-18 01:59:51 +01:00
Nicolas Goaziou 0d24086657 Update some copyright years 2015-02-16 01:40:07 +01:00
Nicolas Goaziou 7ebe87e2d5 org-element: Forbid footnote references in parsed keywords
* lisp/org-element.el (org-element-object-restrictions): Forbid
  footnote references in parsed keywords.

Inserting footnote references in parsed keywords (e.g., TITLE or
CAPTION) can lead to subtle bugs.  Indeed, it is impossible to know in
time if that particular footnote is going to be used in the output,
and, therefore, if it should count, e.g., in
`org-export-get-footnote-number'.
2015-02-15 21:56:57 +01:00
Nicolas Goaziou 176681bc65 org-footnote: Be more strict about location for new footnotes
* lisp/org-footnote.el (org-footnote--allow-reference-p): New
  function.
(org-footnote-new): Use new function.

* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test.

In particular, Org now refuses to add a footnote reference in
a keyword, e.g., TITLE.
2015-02-15 21:56:57 +01:00
Nicolas Goaziou 13938b87c2 org-element: Faster inline footnotes parsing
* lisp/org-element.el (org-element--pair-square-table): New variable.
(org-element-footnote-reference-parser): Use new variable.
2015-02-15 13:33:25 +01:00
Nicolas Goaziou 836d9db8a9 org-list: Fix continuated items repair
* lisp/org-list.el (org-list-struct-apply-struct): Preserve disparate
  indentation in contuated contents, i.e., contents after a plain list
  still within an item.

* testing/lisp/test-org-list.el (test-org-list/repair): Add test.

This fixes the following case:

  - item
     - child
     item contents
       with different indentation

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94977>
2015-02-14 12:37:41 +01:00
Nicolas Goaziou 55ce4b74b3 Fix `org-return' on list items
* lisp/org.el (org-return): Properly preserve list structure when
  calling `org-return-indent' on an item.

* testing/lisp/test-org.el (test-org/return): Add test.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/94977>
2015-02-14 02:07:18 +01:00
Nicolas Goaziou e50baa4cf7 Fix `org-time-stamp'
* lisp/org.el (org-time-stamp): Correctly match repeater, if any.
  Refactor code.

* testing/lisp/test-org.el (test-org/time-stamp): New test.

Reported-by: Nicolas Richard <theonewiththeevillook@yahoo.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94974>
2015-02-13 21:54:21 +01:00
Nicolas Goaziou 68f094a706 ox-odt: Fix nested footnotes export
* lisp/ox-odt.el (org-odt-footnote-reference): Fix nested footnotes
  export.

Reported-by: Vaidheeswaran <vaidheeswaran.chinnaraju@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94900>
2015-02-13 14:14:39 +01:00
Nicolas Goaziou ccb663c742 ox: Add optional order argument to some footnotes related functions
* lisp/ox.el (org-export--footnote-reference-map): New function.
(org-export-footnote-first-reference-p,
org-export-get-footnote-number): Allow to change order when footnotes
references are contained within footnote definitions.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p):
(test-org-export/get-footnote-number):  New tests.
(test-org-export/footnotes): Update test.
2015-02-13 14:10:51 +01:00
Rainer M. Krug b95f7aa823 ob-core.el: Fix numeric error and add header-args
* lisp/ob-core.el (org-babel-view-src-block-info): when a property
  value was numeric, an error was raised. Fixed by converting property
  value to string before evauation.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  "header args" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  for language specific "header args:LANG" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.
2015-02-13 00:39:35 +01:00
Nicolas Goaziou 0ed5d4336b ox-publish: Clean-up `org-publish-find-date'
* lisp/ox-publish.el (org-publish-find-date): Remove useless cond
branch.

:date property is never a single timestamp, so the first branch is
always false.

Reported-by: Rasmus <rasmus@gmx.us>
2015-02-13 00:33:17 +01:00
Rasmus 1cc23c6f3d Fix bugs introduced in b39dd5a
* ox-man.el (org-man-template),
  ox-texinfo.el (org-texinfo-template): Fix bug.
2015-02-12 11:00:56 +01:00
Rasmus e6fcc853c5 ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
  ox-ascii.el (org-ascii-template--document-title),
  ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
  ox-latex.el (org-latex-template), ox-man.el (org-man-template),
  ox-odt.el (org-odt-template), ox-org.el (org-org-template),
  ox-publish.el (org-publish-project-alist),
  ox-texinfo.el (org-texinfo-template),
  ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.

This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-12 01:45:39 +01:00
Nicolas Goaziou fd51dad999 Turn momentarily planning keywords into defvar
* lisp/org.el (org-closed-string, org-deadline-string,
  org-scheduled-string): Use a defvar.

DEADLINE, SCHEDULED and CLOSED are now meant to be constants. However,
we preserve backward-compatibility during obsolencence phase.
2015-02-12 00:46:29 +01:00
Nicolas Goaziou 23d4d869f5 org-agenda: Ignore sticky feature when picking date from calendar
* lisp/org-agenda.el (org-calendar-goto-agenda): Ignore sticky
  feature.

Reported-by: Tory S. Anderson <torys.anderson@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94865>
2015-02-11 23:44:26 +01:00
Nicolas Goaziou d92ef95170 org-agenda: Fix small bug
* lisp/org-agenda.el (org-todo-list): `org-last-args' property
  contains a list, not an atom.
2015-02-10 23:13:56 +01:00
Nicolas Goaziou f620efe1b8 Merge branch 'maint' 2015-02-10 22:27:12 +01:00
Nicolas Goaziou 880a2b4f90 ox-odt: Fix exporting target link without a description
* lisp/ox-odt.el (org-odt-link--infer-description): Fix comment.
(org-odt-link): When link to target has no description, use a number.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94815>
2015-02-10 22:23:40 +01:00
Nicolas Goaziou a4083de5c2 Fix typo
* lisp/org.el (org-read-date-analyze): Fix typo.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/94820>
2015-02-10 17:43:13 +01:00
Nicolas Goaziou 650278f775 org-element: Interpret pseudo objects without declaration
* lisp/org-element.el (org-element-object-containers): New variable
(org-element-interpret-data): Remove optional argument.
(org-element--interpret-data-1): Remove optional argument.  Guess when
a given element or object has a pseudo type.

* lisp/ox-latex.el (org-latex-pseudo-objects): Remove variable.
(org-latex-table, org-latex--math-table): Apply signature change above.

* testing/lisp/test-org-element.el (test-org-element/interpret-data):
  Update test.
2015-02-09 12:04:38 +01:00
Nicolas Goaziou 7f66983184 org-element: Fix docstring
* lisp/org-element.el (org-element-copy): Fix docstring.
2015-02-09 10:57:39 +01:00
Nicolas Goaziou 16841306ed Use `org-element-copy'
* lisp/org.el (org-timestamp-split-range): Use `org-element-copy'.  Do
  not preserve :parent property anymore.

* lisp/ox.el (org-export-as): Use `org-element-copy'.

* testing/lisp/test-org.el (test-org/timestamp-split-range): Update test.
2015-02-09 10:15:59 +01:00
Nicolas Goaziou 70933a3dd6 org-element: Implement `org-element-copy'
* lisp/org-element.el (org-element-copy): New function.
* testing/lisp/test-org-element.el (test-org-element/copy): New test.
2015-02-09 10:07:34 +01:00
Rasmus 8f38f037b4 ox.el: {{{date}}} formatting argument
* ox.el (org-export-as): Allow {{{date}}} to take formatting-argument.
* org.texi (Macro replacement): Document {{{date}}} formatting.
* test-ox.el (test-org-export/expand-macro): Test {{{data(format)}}}
* org-NEWS: Mention optional {{{data}}} argument.

Optional argument to {{{date}}} like {{{date(FMT)}}} are treated
similar to {{{time(FMT)}}} if \#+DATE is a timestamp.
2015-02-09 01:47:21 +01:00
Yuri D. Lensky ba544e4caa Fix timestamp-based sorting of tags-based entries in agenda
* lisp/org.el (org-scan-tags): Fix agenda org tags scans to properly
  add timestamp property, completely analogously to
  org-agenda-get-todos.
* lisp/org-agenda.el (org-agenda-entry-get-agenda-timestamp,
  org-agenda-get-todos): Factored timestamp retrieval code out to
  separate function org-agenda-entry-get-agenda-timestamp from
  org-agenda-get-todos.

Before this fix, timestamps were ignored when sorting agenda views of
the 'tags' and 'tags-todo' types.

TINYCHANGE
2015-02-09 01:08:42 +01:00
Nicolas Goaziou 0be8495d01 Call `org-insert-heading' instead of (insert "* ")
* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level):
* lisp/org.el (org-link-search):  Call `org-insert-heading' instead
  of (insert "* ").

This allows, in particular, to run `org-insert-heading-hook' and
possibly fix up blank lines around.
2015-02-08 01:45:38 +01:00
Nicolas Goaziou ca0199c7ee `org-insert-heading' can be forced to insert top-level headline
* lisp/org.el (org-insert-heading): Change signature.  Tiny refactoring.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
2015-02-08 01:43:30 +01:00