Commit Graph

12007 Commits

Author SHA1 Message Date
Nicolas Goaziou 8fb5987e56 org-export: Fix smart quotes with isolated quotes
* contrib/lisp/org-export.el (org-export-activate-smart-quotes): Fix
  smart quotes in some corner-cases.  Refactor code.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 20:36:03 +01:00
Nicolas Goaziou c7f4a9ebad org-element: Fix accessors and setters wrt secondary strings
* lisp/org-element.el (org-element-contents, org-element-set-contents,
  org-element-adopt-elements): Fix accessors and setters wrt secondary
  strings.
2012-10-29 19:03:54 +01:00
Nicolas Goaziou 07c8895705 org-element: Fix void-function org-clocking-buffer error
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): Fix void-function
  org-clocking-buffer error.
2012-10-29 16:26:34 +01:00
Nicolas Goaziou 2e8591783f org-element: Fix org-element-context on parsed keywords
* lisp/org-element.el (org-element-context): Fix org-element-context
  on parsed keywords.
* testing/lisp/test-org-element.el: Update test.
2012-10-29 14:01:49 +01:00
Nicolas Goaziou a2120a9d73 org-export: Expand correctly {{{title}}} and such
* contrib/lisp/org-export.el (org-export-as): Expand correctly
  {{{title}}} and such when they already contain a regular macro.
  This is done by expanding macros in two steps: at first regular
  macros,  then document specific macros.
(org-export-expand-macro): Remove function.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 14:01:20 +01:00
Nicolas Goaziou a8c026cb26 org-export: Explicit error when using invalid syntax for INCLUDE keywords
* contrib/lisp/org-export.el (org-export-expand-include-keyword):
  Error out when file isn't specified within double quotes.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 11:31:19 +01:00
Nicolas Goaziou 99110c60a6 org-element: Find objects in document and parsed affiliated keywords
* lisp/org-element.el (org-element-context): Find objects in document
  and parsable affiliated keywords.
* testing/lisp/test-org-element.el: Add tests.
2012-10-29 11:09:41 +01:00
Nicolas Goaziou 89ec3f1abf org-element: Add `:post-affiliated' property to elements when applicable
* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-parser, org-element-dynamic-block-parser,
  org-element-footnote-definition-parser,
  org-element-plain-list-parser, org-element-property-drawer-parser,
  org-element-quote-block-parser, org-element-special-block-parser,
  org-element-babel-call-parser, org-element-comment-parser,
  org-element-comment-block-parser, org-element-diary-sexp-parser,
  org-element-example-block-parser, org-element-export-block-parser,
  org-element-fixed-width-parser, org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element-latex-environment-parser,
  org-element-paragraph-parser, org-element-src-block-parser,
  org-element-table-parser, org-element-verse-block-parser): Add
  `:post-affiliated' property to elements.
(org-element-inlinetask-parser): Remove affilated keywords.
* lisp/org.el (org-adaptive-fill-function): Use new property.

This property is cheap to compute during parsing and allows to
determine if point is on an affiliated keyword or not by checking if
it is between :begin and :post-affiliated positions.
2012-10-29 11:02:06 +01:00
Bastien Guerry 0513f11b16 Merge branch 'maint' 2012-10-29 07:41:29 +01:00
Le Wang d22e732d7a org-src.el (org-edit-src-exit): Fix editing source section with blank lines
* org-src.el (org-edit-src-exit): Fix editing source section
with blank lines.

TINYCHANGE

This bug was introduced by commit aba9e2b9.
2012-10-29 06:37:41 +01:00
Rafael Laboissiere d0dd2a5308 org-remember.el: Correctly strip the comment lines in remember buffer
* org-remember.el (org-remember-handler): Correctly strip the comment lines
  in the temporary buffer *Remember* when handling a remember note.

TINYCHANGE
2012-10-29 06:30:14 +01:00
Nicolas Goaziou 90fcb4b841 org-export: Add filter set for diary sexp elements
* contrib/lisp/org-export.el (org-export-filters-alist): Add filter
  set for diary sexp elements.
(org-export-filter-comment-block-functions): Fix docstring.
(org-export-filter-diary-sexp-functions): New variable.
2012-10-28 23:00:04 +01:00
Nicolas Goaziou 98d5666bac org-element: Allow duals keywords with only secondary value
* lisp/org-element.el (org-element--collect-affiliated-keywords):
  Allow duals keywords with only secondary value.
* testing/lisp/test-org-element.el: Add test.

This patch allows to parse correctly the following:

    #+CAPTION[short caption]:
    #+CAPTION: Very long caption
    Some paragraph.
2012-10-28 22:45:34 +01:00
Nicolas Goaziou f6e936c2b9 Export back-ends: Update timestamp export
* contrib/lisp/org-e-ascii.el (org-e-ascii-timestamp): Update
  timestamp export.
* contrib/lisp/org-e-groff.el (org-e-groff-timestamp): Update
  timestamp export.
* contrib/lisp/org-e-html.el (org-e-html-timestamp): Update timestamp
  export.
* contrib/lisp/org-e-latex.el (org-e-latex-timestamp): Update
  timestamp export.
* contrib/lisp/org-e-odt.el (org-e-odt-timestamp): Update timestamp
  export.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-timestamp): Update
  timestamp export.
2012-10-28 16:36:45 +01:00
Nicolas Goaziou c1e3aaece3 org-element: Improve timestamps parsing
* lisp/org-element.el (org-element-timestamp-parser): Modify timestamp
  objects properties.
(org-element-headline-parser, org-element-inlinetask-parser): Remove
`:timestamp' and `:clock' property.  Add `:clockedp' property.  Also,
set `:closed', `:deadline' and `:scheduled' values to timestamp
objects, not strings.  Small refactoring.
(org-element-clock-parser): Rename `:time' property into `:duration'.
Also, set `:value' value as a timestamp object, not a string.
(org-element-planning-parser): Set `:closed', `:deadline' and
`:scheduled' values to timestamp objects, not strings.
(org-element-clock-interpreter, org-element-planning-interpreter)
(org-element-timestamp-interpreter): Update interpreters.
(org-element--current-element): Tiny refactoring.
* testing/lisp/test-org-element.el: Add tests.
2012-10-28 16:29:55 +01:00
Nicolas Goaziou 2f2a80fe06 ob: Fix block evaluation in a narrowed buffer
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
  keyword in current narrowed part of buffer, if necessary. Small
  refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted.  Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el
2012-10-28 16:21:30 +01:00
Nicolas Goaziou ccc98ebc2d org-export: Fix expansion of babel calls in included files
* contrib/lisp/org-export.el (org-export-as):
  `org-current-export-file' should refer to current, temporary, buffer
  containing included contents, not to original buffer with include
  keywords.
(org-export-with-current-buffer-copy): Buffer copy must contain the
whole buffer, possibly narrowed to a proper part, not only the
narrowed part.
* testing/lisp/test-org-export.el: Tweak tests.
2012-10-28 16:21:30 +01:00
Nicolas Goaziou a729fae0f7 org-agenda: Tiny stylistic change
* lisp/org-agenda.el (org-agenda-get-deadlines): Tiny stylistic
  change.
2012-10-28 13:53:29 +01:00
Bastien Guerry a4660d4790 org.el (org-additional-option-like-keywords): Add "INDEX:"
* org.el (org-additional-option-like-keywords): Add "INDEX:".
2012-10-28 11:39:01 +01:00
Justus Piater 796fca3f18 org-agenda: New option: skip deadline prewarning if scheduled in the future
* lisp/org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled):
  Add an option to skip the deadline prewarning if the scheduled date is
  in the future.
2012-10-28 11:13:53 +01:00
Bastien Guerry 53a7683fd7 Merge branch 'maint' 2012-10-28 11:10:44 +01:00
Rafael Laboissiere f9e89cb849 org-remember.el: Start the commented lines with the appropriate characters
* org-remember.el (org-remember-apply-template): Start the commented
  lines in the Remember temporary buffer with the appropriate
  characters.

TINYCHANGE
2012-10-28 11:10:28 +01:00
Bastien Guerry 70e4a89a5d Merge branch 'maint' 2012-10-27 21:44:21 +02:00
Bastien Guerry 4aa416876b org.texi (Comment lines): Fix description of the comment syntax
* org.texi (Comment lines): Fix description of the comment
syntax.

Thanks to Rafael Laboissiere for reporting this.
2012-10-27 21:44:09 +02:00
Nicolas Goaziou d81982ae9d org-element: Parse diary-sexp elements
* lisp/org-element.el (org-element-paragraph-separate): Diary-sexp
  elements can separate paragraphs.
(org-element-all-elements): Install new `diary-sexp' type.
(org-element--current-element): Recognize new `diary-sexp' elements.
(org-element-diary-sexp-parser, org-element-diary-sexp-interpreter):
New functions.
* testing/lisp/test-org-element.el: Add tests.
2012-10-27 14:43:30 +02:00
Nicolas Goaziou 1d58b0b2cd org-element: Small refactoring
* lisp/org-element.el (org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element--current-element): Small
  refactoring.
2012-10-27 14:37:18 +02:00
Nicolas Goaziou f04a5bcea1 Export back-ends: Install smart quotes module
* contrib/lisp/org-e-ascii.el (org-e-ascii-plain-text): Install smart
  quotes module.
* contrib/lisp/org-e-html.el (org-e-html-plain-text): Install smart
  quotes module.  Fix :preseve-breaks option.
(org-e-html--quotation-marks): Remove function.
(org-e-html-quotes): Remove variable.
* contrib/lisp/org-e-latex.el (org-e-latex-plain-text): Install smart
  quotes module.
(org-e-latex--quotation-marks): Remove function.
(org-e-latex-quotes): Remove variable.
* contrib/lisp/org-e-odt.el (org-e-odt-plain-text): Install smart
  quotes module.
(org-e-odt--quotation-marks): Remove function.
(org-e-odt-quotes): Remove variable.
* contrib/lisp/org-md.el (org-md-plain-text): Install smart quotes
  module.  Fix characters escaping.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-center-block,
  org-e-texinfo-special-block): new functions.
(org-e-texinfo-quotes): Remove variable.
(org-e-texinfo--quotations-marks): Remove function.
(org-e-texinfo-plain-text): Install smart quotes module.
* contrib/lisp/org-e-groff.el (org-e-groff-plain-text): Install smart
quotes module.  Fix line break preservation.
(org-e-groff--quotation-marks): Remove function.
(org-e-groff-quotes): Remove variable.
(org-e-groff-entity): Fix property name.
* contrib/lisp/org-e-man.el (org-e-man-entity): Fix property name.
(org-e-man-plain-text): Install smart quotes module.  Fix line break
preservation.
(org-e-man-quotes): Remove variable.
(org-e-man--quotation-marks): Remove function.
2012-10-27 11:42:31 +02:00
Nicolas Goaziou b2047a2565 org-export: Implement a generic smart quote module
* contrib/lisp/org-export.el (org-export-options-alist): Add an option
  item to toggle smart quotes during export.
(org-export-with-smart-quotes, org-export-smart-quotes-alist,
org-export-smart-quotes-regexps): New variables.
(org-export-activate-smart-quotes): New function.
(org-export-data): Remove residual text properties.
* testing/lisp/test-org-export.el: Add tests.
2012-10-27 11:42:31 +02:00
Nicolas Goaziou 95c305490e org-element: Add :parent text property to strings in parse tree
* lisp/org-element.el (org-element-property): Access to text
  properties when argument is a string.
(org-element-put-property): Correctly set property when target is
a string.
(org-element-adopt-elements): Also put :parent properties on strings.
* testing/lisp/test-org-element.el: Add test.
2012-10-27 11:42:30 +02:00
Bastien Guerry 7221b88f6d Merge branch 'maint' 2012-10-27 09:39:12 +02:00
Erik Hetzner dda453eb7e org.el (org-log-into-drawer): Honor the nil value for the :LOG_INTO_DRAWER: property.
* org.el (org-log-into-drawer): Honor the nil value for the
:LOG_INTO_DRAWER: property.

TINYCHANGE
2012-10-27 09:37:54 +02:00
Bastien Guerry b0eeb260ef Merge branch 'maint' 2012-10-27 09:25:18 +02:00
Bastien Guerry b1f20bde27 org-install.el: Enhance warning
* org-install.el: Enhance warning.

Thanks to Simon Thum for requesting this.
2012-10-27 09:25:14 +02:00
Bastien Guerry 4c3527d2e6 Merge branch 'maint' 2012-10-27 09:08:35 +02:00
Bastien Guerry 1fe4e9ecc7 org.texi (Installation): Mention "make test" in the correct section
* org.texi (Installation): Mention "make test" in the correct
section.

Thanks to Uvius for reporting this problem.
2012-10-27 09:08:28 +02:00
Nicolas Goaziou 00eaa4dc97 org-export: Fix error when exporting buffers not visiting a file
* contrib/lisp/org-export.el (org-export-output-file-name): Do not
  return an error when exported buffer isn't visiting a file.
2012-10-27 00:02:52 +02:00
Bastien Guerry a29de08ff7 Merge branch 'maint' 2012-10-26 15:59:10 +02:00
Bastien Guerry acbbe2d5b2 Fix typo in refcard and whitespaces in org.texi. 2012-10-26 15:59:06 +02:00
Bastien Guerry 8866f86624 Merge branch 'maint' 2012-10-26 15:12:02 +02:00
Bastien Guerry 7a9d345707 Remove the obsolete argument `hidden' from `org-export-as-latex'.
* org-latex.el (org-export-as-latex): Remove obsolete argument
`hidden'.  Also fix the docstring: using 'string as the value
for `to-buffer' outputs a string with no LaTeX header.
(org-export-as-latex-batch)
(org-export-as-latex-to-buffer, org-export-region-as-latex)
(org-export-as-pdf): Don't use the obsoleted argument.

* ob-haskell.el (org-export-as-latex): Don't use the obsoleted
argument `hidden'.
2012-10-26 15:05:10 +02:00
Bastien Guerry 116c09053f Run `bookmark-set' within `with-demoted-errors'.
* org.el (org-refile): Run within `with-demoted-errors' so
that a corrupted bookmark file does not stop the refile
process.

* org-capture.el (org-capture-bookmark-last-stored-position):
Ditto for the capture process.

Note: we do not prevent such errors in org-remember.el as this
libary will be obsoleted for the next major release of Org.
2012-10-26 14:55:08 +02:00
Bastien Guerry 3cd0c14d34 contrib/lisp/org-contacts.el: Require 'org-agenda.
Thanks to Christopher Schmidt for pointing this.
2012-10-26 14:49:09 +02:00
Myles English db8e06147a Clocking: Move to task before calling org-clock-in-prepare-hook
* lisp/org-clock.el (org-clock-in): Moved the call to
org-clock-in-prepare-hook until the task's properties
can be accessed.

The problem was when using a function to add an effort
property via the hook, it would not recognise an existing
effort property when called with the prefix (C-u C-c C-x C-i)
with the point at a place other than at the task.

TINYCHANGE
2012-10-26 14:47:23 +02:00
Toby S. Cubitt 58551f1e5f Fix bug in org-agenda-diary-sexp-prefix
* lisp/org-agenda.el (org-agenda-get-sexps): Reset `extra' to nil at
beginning of re-search-forward loop, otherwise next iteration picks up
`extra' value from previous entry.
2012-10-26 14:46:24 +02:00
Achim Gratz b5aded108d Merge branch 'maint' 2012-10-26 08:18:59 +02:00
Achim Gratz 73cfba486b ob-ditaa: needs to require org-compat for org-find-library-dir
* lisp/ob-ditaa.el: Needs to (require 'org-compat) for org-find-library-dir.
2012-10-26 08:18:07 +02:00
Nicolas Goaziou 78c5838e4e ob-exp: Escape code when re-creating a src blocks
* lisp/ob-exp.el (org-babel-exp-code): Escape code when re-creating
  a src blocks.
2012-10-25 16:24:48 +02:00
Nicolas Goaziou c712d65397 org-e-texinfo: Update compile function
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-compile): Mirror recent
changes about base filename and default-directory made to
`org-e-latex-compile'.
2012-10-25 16:07:13 +02:00
Nicolas Goaziou ec40ba021a org-e-man, org-e-groff: Update compile functions
* contrib/lisp/org-e-groff.el (org-e-groff-compile): Mirror recent
  changes about base filename and default-directory made to
  `org-e-latex-compile'.
* contrib/lisp/org-e-man.el (org-e-man-compile): Mirror recent changes
  about base filename and default-directory made to
  `org-e-latex-compile'.
2012-10-25 16:06:18 +02:00
Nicolas Goaziou 4bb5a06b15 org-e-latex: "%b" really means base filename
* contrib/lisp/org-e-latex.el (org-e-latex-pdf-process): Update
  docstring.
(org-e-latex-compile): "%b" is replaced with base filename, that is
filename without directory and extension.
2012-10-25 15:13:40 +02:00