Commit Graph

14892 Commits

Author SHA1 Message Date
Nicolas Goaziou ba20e937ae ob-exp: Fix duplicate evaluation with :wrap src
* lisp/ob-exp.el (org-babel-exp-process-buffer): Fix duplicate
  evaluation with :wrap src.
(org-babel-exp-non-block-elements): Removed function.
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines): Fix test.
2013-12-06 16:40:23 +01:00
Nicolas Goaziou 37eb0df867 Move `org-comment-dwim' in an appropriate section
* lisp/org.el (org-comment-dwim): Move function into "comment" related
  part of the library.
2013-12-06 16:37:57 +01:00
Bastien Guerry 3f6b1dcfd4 Merge branch 'maint' 2013-12-06 15:23:05 +01:00
Bastien Guerry 6a86f32c70 org-attach.el: Check whether git is installed
* org-attach.el (vc-git): Require.
(org-attach-commit): Check whether git is installed.

Thanks to Jonathan Leech-Pepin for reporting this.
2013-12-06 15:22:50 +01:00
Bastien Guerry 487c74580c Fix bug when commenting source code.
* org.el (org-babel-do-in-edit-buffer): Declare.
(org-babel-load-file, org-insert-comment)
(org-comment-or-uncomment-region): Don't require 'ob-core.
(org-mode-map): Remap `comment-dwim' to `org-comment-dwim'.
(org-comment-dwim): New command.

* ob-core.el (org-babel-do-in-edit-buffer): Make an autoload.

See http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00154.html
for a discussion about this bug.
2013-12-06 10:45:35 +01:00
Nicolas Goaziou 3a317abc23 Merge branch 'maint' 2013-12-03 21:50:45 +01:00
Nicolas Goaziou af6f14d907 Fix C-c C-c behaviour on some objects
* lisp/org.el (org-ctrl-c-ctrl-c): When point is on an unsupported
  object, look for something to do at a higher level instead of
  bailing out.

For example, C-c C-c should toggle checkbox in the following example
even though X point is technically on a subscript.

  - [ ] a_Xb
2013-12-03 21:41:48 +01:00
Nicolas Goaziou 3f6c64a8e2 ox-publish: Introduce `org-publish-after-publishing-hook'
* lisp/ox-publish.el (org-publish-after-publishing-hook): New variable.
(org-publish-file): Call hook with file name and output file name as
arguments.  Small refactoring.
(org-publish-attachment): Return output file.
2013-12-03 21:10:59 +01:00
Nicolas Goaziou 317efee93b Merge branch 'maint'
Conflicts:
	contrib/lisp/org-drill.el
2013-12-03 21:02:48 +01:00
Nicolas Goaziou 8953b417f2 ox-html: Fix LaTeX fragments export
* lisp/ox-html.el (org-html-format-latex): Add an argument.  Ensure
  latex header is the same as specified in the original buffer when
  exporting a LaTeX fragment or environment.
(org-html-latex-environment, org-html-latex-fragment): Apply signature
change.
2013-12-03 20:57:08 +01:00
Nicolas Goaziou f9a73edc24 ox-bibtex: Tiny refactoring
* contrib/lisp/ox-bibtex.el (org-bibtex-process-bib-files): Tiny
  refactoring.
2013-12-03 20:21:09 +01:00
Carsten Dominik 0b3657e8d3 Fix customization types in org-drill.el
* contrib/lisp/org-drill.el (org-drill-leech-method):
(org-drill-scope):
(org-drill-spaced-repetition-algorithm): Fix customization types.
2013-12-03 18:05:01 +01:00
Carsten Dominik 64a64856c0 Fix customization types in org-drill.el
* contrib/lisp/org-drill.el (org-drill-leech-method):
(org-drill-scope):
(org-drill-spaced-repetition-algorithm): Fix customization types.
2013-12-03 18:03:49 +01:00
Eric Schulte e2ab44d9fb ascii export backend support to ox-bibtex w/pandoc 2013-12-02 12:24:58 -07:00
Eric Schulte baa44f6542 add --set=\"ON_ERROR_STOP=1\" to psql execution
Thanks to Joost Helberg for suggesting this change.

* lisp/ob-sql.el (org-babel-execute:sql): Add
  --set=\"ON_ERROR_STOP=1\" to psql execution.
2013-12-01 11:07:16 -07:00
Nicolas Goaziou d173e6c6db ox-bibtex: Merge consecutive citations
* contrib/lisp/ox-bibtex.el (org-bibtex-merge-contiguous-citations):
  New function.
(org-latex-link, org-html-link): Remove advices.
2013-12-01 17:05:34 +01:00
Nicolas Goaziou cccac9a4ed ox-bibtex: Small refactoring
* contrib/lisp/ox-bibtex.el (org-bibtex-process-bib-files): Execute
  function only when back-end is HTML.
2013-12-01 17:05:34 +01:00
Nicolas Goaziou cd439bc513 org-element: Extend `org-element-set-element' to strings
* lisp/org-element.el (org-element-set-element): Allow to replace
  a string with an element, an element with a string, or a string with
  a string.
2013-12-01 17:05:34 +01:00
Nicolas Goaziou 798ad3a27e org-element: Implement `org-element-insert-before'
* lisp/org-element.el (org-element-insert-before): New function.
* testing/lisp/test-org-element.el (test-org-element/insert-before):
  New test.
2013-12-01 17:05:34 +01:00
Nicolas Goaziou b0216248e3 org-element: Implement `org-element-extract-element'
* lisp/org-element.el (org-element-extract-element): New function.
* testing/lisp/test-org-element.el (test-org-element/extract-element):
  New test.
2013-12-01 17:05:34 +01:00
Nicolas Goaziou 0fd4245a43 org-element: Implement `org-element-secondary-p'
* lisp/org-element.el (org-element-secondary-p): New function.
* lisp/ox.el (org-export-get-previous-element,
  org-export-get-next-element): Use new function.
* testing/lisp/test-org-element.el (test-org-element/secondary-p): New
  test.
2013-12-01 17:05:34 +01:00
Eric Schulte 0e376f2cd0 support for D language code blocks in contrib
Thanks for Thierry Banel for contributing ob-D.
2013-12-01 06:56:10 -07:00
Nicolas Goaziou 0cff09f94b Merge branch 'maint' 2013-12-01 13:41:09 +01:00
Nicolas Goaziou c92606b326 Documentation for :export: tag usage
* doc/org.texi (Export settings): documentation describing how text
above the first heading is ignored when an :export: tag is in a file.

Commit 7cf4406088 introduced a feature of
the exporter that ignores text above the first headline when an :export:
tag is used anywhere in a file. This commit documents that behaviour
introduced in 7cf44060, in doc/org.texi.

TINYCHANGE
2013-12-01 13:32:26 +01:00
Achim Gratz 61e8f03364 mk/default.mk, testing/org-test.el: set org-startup-folded to nil
* mk/default.mk (BATCH), testing/org-test.el: Set `org-startup-folded´
  to nil to avoid lots of "OVERVIEW" messages cluttering the output.
2013-11-30 17:02:46 +01:00
Nicolas Goaziou 45509c4490 ox: Fix erroneous code comment
* lisp/ox.el (org-export--generate-copy-script): Fix code comment.
2013-11-29 10:07:31 +01:00
Nicolas Goaziou 320ae9021e ox: Fix cache confusion during export
* lisp/ox.el (org-export--generate-copy-script): Do not share cache
  when copying buffers since keys and values are modified by
  side-effect.
2013-11-28 22:19:29 +01:00
Nicolas Goaziou 7ba387bdd2 Merge branch 'maint' 2013-11-28 11:46:33 +01:00
Nicolas Goaziou 07cbf9aa13 ox-freemind: Fix comma error when exporting
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind): Fix
  code typo.

Reported-by: Jan-Mark Batke <badkey@gmx.net>
2013-11-28 11:44:44 +01:00
Bastien Guerry c811bb0ea5 org.el (org-cycle-hide-drawers): Fix bug about re-searching at the wrong side of point
* org.el (org-cycle-hide-drawers): Fix bug about re-searching
at the wrong side of point.

The bug was introduced by this commit:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e8bafd

And reported here:
http://article.gmane.org/gmane.emacs.orgmode/79282
2013-11-28 06:27:57 +01:00
Achim Gratz e655e664bf org: check for derived-mode-p instead of "org-mode" exactly
* lisp/org.el (org-mode-restart): Check for derived-mode-p instead of
  "org-mode" exactly.  This covers a situation normal-mode already
  instantiates a derived mode (e.g. via file local variables).
2013-11-27 20:52:03 +01:00
Achim Gratz f2483ec4bb org: fix commit 0911edfac8
* lisp/org.el (org-mode-restart): After `normal-mode´ the mode may not
  be "org-mode".  Explicitly switch to org-mode in that case.
2013-11-27 19:56:38 +01:00
Nick Dokos 0911edfac8 Second try: Ensure that file local variables are set
* lisp/org.el (org-mode-restart): Call normal-mode,
  instead of org-mode. This will set the mode but it
  will also set file local variables properly.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.

The original fix (commit 5ea0228) was incorrect: if the
local variable was a mode setting, then we ended up in an
"infinite" recursion. Problem found, reported and a reproducer
provided by York Zhao.
2013-11-27 09:19:56 -05:00
Nick Dokos a82a5206f3 Revert "Ensure that file local variables are set"
This reverts commit 5ea02285ba.

York Zhao ran into an infinite recursion with this "fix".
2013-11-27 09:19:55 -05:00
Nicolas Goaziou 5a2dabc21b org-element: Optimize parser only when cache is active
* lisp/org-element.el (org-element-at-point): Try opportunistic
  shortcut only when cache is active.
2013-11-26 23:51:26 +01:00
Nicolas Goaziou 15246d1165 org-colview: Silence byte-compiler 2013-11-26 18:23:35 +01:00
Nicolas Goaziou 71c8474ae9 org-element: Speed-up for `org-element-at-point'
* lisp/org-element.el (org-element-at-point): Rewrite function. Remove
  optional argument.

Include an opportunistic search at the beginning of the function.  It
drastically improves speed on large sections for a small overhead on
small ones.
2013-11-26 18:18:33 +01:00
Nicolas Goaziou 2b22886005 org-element: Prepare signature change
* lisp/ob-exp.el: Declare signature change.
* lisp/org-macro.el: Declare signature change.
* lisp/org.el (org-backward-element, org-drag-element-backward): Avoid
  using optional argument from `org-element-at-point'.
* testing/lisp/test-org-element.el: Update test.
2013-11-26 18:08:19 +01:00
Carsten Dominik 0ae48c544b Fix bug in uncompilation of column format
* lisp/org-colview.el (org-columns-uncompile-format): Fix bug when retrieving
operator symbol.
2013-11-26 13:14:06 +01:00
York Zhao f1583aab46 Fix problem with :exact-positions in capture
* lisp/org-capture.el (org-capture-place-entry): Set :exact-position
before doing other stuff, to allow function with other target settings

TINYCHANGE

Assuming file "test.org" has a single headline "* Level 1" (ended with
newline character), when trying to use function type capture target in
an org-capture template, as shown in the example:

(setq org-capture-templates
      `(("t"
         "Test function type target"
         entry
         (function
          (lambda ()
            (set-buffer (org-capture-target-buffer "test.org"))
            (goto-char (point-max))))
         "* Level 2")))

When this template gets filled, file "test.org" becomes:

* Level 1
* Level 2

Instead of:

* Level 1
** Level 2

This is because when using function type target, `:exact-position' is
used to store buffer position returned by user's function (the lambda
function here), and function `org-capture-place-entry' will never
insert template as a child of current entry when `:exact-position' is
used.

The problem is addressed by not special casing for `:exact-position'
in function `org-capture-place-entry'.

York
2013-11-26 06:28:07 +01:00
Carsten Dominik 48db329296 Merge branch 'master' of orgmode.org:org-mode 2013-11-26 06:20:40 +01:00
Nicolas Goaziou a9eec72ecf Merge branch 'maint' 2013-11-25 23:36:38 +01:00
Nicolas Goaziou 3ead82a321 ox-publish: Error when publishing non-existent file
* lisp/ox-publish.el (org-publish-cache-ctime-of-src): Return an error
  when publishing a non-existent file.

Suggested-by: Arne Babenhauserheide <arne_bab@web.de>
2013-11-25 23:34:20 +01:00
Nicolas Goaziou 7bee47120b org-element: Update paragraph separate regexp
* lisp/org-element.el (org-element-paragraph-separate): More accurate
  regexp.
2013-11-25 23:19:48 +01:00
David Arroyo Menendez be8a1a2d69 org-license.el: add images directory to public domain functions 2013-11-24 22:09:37 +01:00
David Arroyo Menendez 06d1f7c3fa org-license.el: add public domain functions 2013-11-24 21:38:27 +01:00
Nicolas Goaziou 4a27c2b4b6 Improved Flyspell checks
* lisp/org.el (org-mode-flyspell-verify): Rewrite function using
  Org parser.  As a consequence, Org is more cautious about areas
  where checks are allowed.
(org-fontify-meta-lines-and-blocks-1, org-activate-footnote-links): Be
subtler when removing flyspell overlays.
(org-unfontify-region): Remove reference to unused `org-no-flyspell'
property.
(org-fontify-drawers): New function.
(org-set-font-lock-defaults): Use new function to fontify drawers.
* contrib/lisp/org-wikinodes.el (org-wikinodes-activate-links): Remove
reference to unused `org-no-flyspell' property.
2013-11-24 16:14:09 +01:00
Eric Schulte 8c98879d7c declare function to appease compiler
* lisp/ob-C.el (org-remove-indentation): Declare function to appease
  compiler.
* lisp/ob-core.el (org-remove-indentation): Declare function to
  appease compiler.
* lisp/ob-fortran.el (org-remove-indentation): Declare function to
  appease compiler.
2013-11-23 17:02:22 -07:00
Eric Schulte 39070b7fc7 sometimes remove common indentation when trimming
* lisp/ob-C.el (org-babel-C-execute): Remove common indentation when
  trimming.

* lisp/ob-core.el (org-babel-read-result): Remove common indentation
  when trimming.
  (org-babel-update-block-body): Remove common indentation when
  trimming.

* lisp/ob-fortran.el (org-babel-execute:fortran): Remove common
  indentation when trimming.

* lisp/ob-tangle.el (org-babel-process-comment-text): Better default
  to process tangled comments.
2013-11-23 15:57:29 -07:00
Eric Schulte 6a4dfd3182 fixed export of inline src blocks
* lisp/ob-exp.el (org-babel-exp-non-block-elements): Fixed export of
  inline src blocks.
2013-11-23 12:24:58 -07:00