Commit Graph

7523 Commits

Author SHA1 Message Date
Nicolas Goaziou 0421be2cee Merge branch 'maint' 2012-11-13 15:46:33 +01:00
Nicolas Goaziou 5dbccdb432 org-list: Fix infloop when inserting an item
* lisp/org-list.el (org-list-separating-blank-lines-number): When
  computing number of blank lines separating items, also count those
  in unparsed blocks, like example blocks.
* testing/lisp/test-org-list.el: Add tests.

In the following situation, with `org-blank-before-new-entry' set to
`auto' for `plain-list-item, a blank line should be inserted when
inserting the following item:

- item1
  #+BEGIN_EXAMPLE

  contents

  #+END_EXAMPLE
2012-11-13 15:45:09 +01:00
Nicolas Goaziou 6d099eedc8 org-element: Allow footnote references in table cells
* lisp/org-element.el (org-element-object-restrictions): Add footnote
  references objects in table cells.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference,
  org-e-latex-table): Add support for footnote reference in table
  cells.
2012-11-12 21:14:43 +01:00
Nicolas Goaziou c40a0dbd38 org-element: Clear text properties when interpreting a string
* lisp/org-element.el (org-element-interpret-data): Clear text
  properties when interpreting a string .
2012-11-11 23:47:34 +01:00
Nicolas Goaziou 94605246e5 Merge branch 'maint' 2012-11-09 02:47:23 +01:00
Toby S. Cubitt 2aeb28d2af Bug fix in org-beginning-of-line visual line motion
* lisp/org.el (org-beginning-of-line): check `visual-line-mode'
instead of `line-visual-mode' to determine whether to move by visual
lines.

* lisp/org.el (org-kill-line): use of org-bound-and-true-p macro.

* testing/lisp/test-org.el: Add test
2012-11-09 02:46:21 +01:00
Achim Gratz c149e04ade Merge branch 'maint' 2012-11-07 18:45:25 +01:00
Achim Gratz ca5d5e9c9b Makefile: fix a bug with ORG_ADD_CONTRIB
* lisp/Makefile: The added files from contrib need to be known before
  LISPF is constructed.  Also, make all variables simply defined to
  avoid recursive evaluation.
2012-11-07 18:44:20 +01:00
Eric Schulte c2ebeea6f6 fix bug in drawer results (should not escape)
* lisp/ob.el (org-babel-insert-result): Don't escape results in drawers.
2012-11-06 06:20:43 -07:00
Nicolas Goaziou 854ddf635c Merge branch 'maint' 2012-11-05 17:40:48 +01:00
Nicolas Goaziou c20730be9a Fix `org-end-of-line' behaviour in visual line mode
* lisp/org.el (org-end-of-line): When visual line mode is on, really
  move by visual lines.  Small refactoring.
2012-11-05 17:39:06 +01:00
Nicolas Goaziou d94a0bcd61 org-capture: Fix docstring
* lisp/org-capture.el (org-capture--expand-keyword-in-embedded-elisp):
  Fix docstring.
2012-11-05 13:38:18 +01:00
Nicolas Goaziou 6e31cf5a1e Merge branch 'maint' 2012-11-05 09:51:02 +01:00
Rafael Laboissiere 209afadbf9 org-bibtex.el: Fix broken URL
* lisp/org-bibtex.el: In the documentation section of the file, fix
  the broken URL to Andrew Roberts' document on BibTeX entries.

TINYCHANGE
2012-11-05 09:50:04 +01:00
Ryo TAKAISHI fb143b6787 org-capture: Expand keywords within %(sexp) placeholder in template
* lisp/org-capture.el: (org-capture--expand-keyword-in-embedded-elisp): New function.
(org-capture-expand-embedded-elisp): Use new function.
2012-11-05 01:29:25 +01:00
Nicolas Goaziou 5acffad561 Merge branch 'maint' 2012-11-05 00:58:34 +01:00
Nicolas Goaziou f48a8b7bf8 Fix end of line function called on an hidden block
* lisp/org.el (org-end-of-line): On a hidden block make sure to
  delegate motion to `end-of-line' instead of `move-end-of-line' in
  order to stay on the current line.
* testing/lisp/test-org.el: Update test.
2012-11-05 00:57:56 +01:00
Eric Schulte 32a6bae7c0 better hline and None translations in ob-python
* lisp/ob-python.el (org-babel-python-hline-to): Customize hline
  conversion to python.
  (org-babel-python-None-to): Customize none conversion from python.
  (org-babel-python-var-to-python): Use new variable.
  (org-babel-python-table-or-string): Use new variable.
2012-10-30 18:04:50 -06:00
Nicolas Goaziou 3ea9372860 Fix error when filling items
* lisp/org.el (org-adaptive-fill-function): Items do not have
  a :post-affiliated property. Use :begin property instead.

This patch follows 86f2731125.
2012-10-30 18:38:39 +01:00
Nicolas Goaziou 5e30d4fa4e org-element: Remove :clockedp property from headlines and inlinetasks
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): Remove :clockedp property.

This property isn't even remotely related to the structure of the
document and, as such, doesn't belong to Org element.
2012-10-30 13:13:47 +01:00
Nicolas Goaziou 86f2731125 Fix error when auto filling
* lisp/org.el (org-adaptive-fill-function): All elements do not have
  a :post-affiliated property.
2012-10-30 13:05:56 +01:00
Nicolas Goaziou 6290da183c Signal an error when a circular macro expansion happens
* lisp/org.el (org-macro-replace-all): Signal an error when a circular
  macro expansion happens.
(org-macro-initialize-templates): Fix docstring.
* testing/lisp/test-org.el: Add test.
2012-10-30 09:24:55 +01:00
Nicolas Goaziou 1f3a2c42c6 org-element, org-export: Fix documentation typos
* contrib/lisp/org-export.el (org-export--get-subtree-options): Fix
  code comment.
* lisp/org-element.el (org-element-map): Fix docstring.
2012-10-29 21:57:46 +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 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 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 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 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
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 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 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
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