Commit Graph

116 Commits

Author SHA1 Message Date
Tim Landscheidt b289a65be7 Use https for links to orgmode.org
TINYCHANGE
2018-01-19 18:14:58 +01:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Nicolas Goaziou c1c5786c8a ob-lob: Expand blocks before ingesting them
* lisp/ob-lob.el (org-babel-lob-ingest): Expand blocks before
  ingesting them.

Reported-by: edgar@openmail.cc
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00361.html>
2017-09-28 23:04:54 +02:00
Paul Eggert ff0dcf52a5 Backport commit bc511a64f from Emacs
Prefer HTTPS to FTP and HTTP in documentation
bc511a64f6da9ab51acc7c8865e80c4a4cb655c2
Paul Eggert
Wed Sep 13 15:54:37 2017 -0700
2017-09-17 00:28:38 -04:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Nicolas Goaziou 3b3fc520aa Fix coderef handling in source blocks
* lisp/ob-core.el (org-babel--normalize-body): Do not remove coderef.
(org-babel-get-src-block-info): Add coderef label information, when
available, to the return value.
(org-babel-execute-src-block): Expand noweb and remove coderefs
non-destructively.
* lisp/ob-lob.el (org-babel-lob-get-info): Adapt to new INFO.

* testing/lisp/test-ob-exp.el (ob-export/body-with-coderef):
* testing/lisp/test-ob.el (test-ob/evaluate-body-with-coderefs): Add
  tests.

Reported-by: Thibault Marin <thibault.marin@gmx.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108888>
2016-08-28 11:56:14 +02:00
Nicolas Goaziou 9930c40790 ob-lob: Fix Library of Babel loading
* lisp/ob-lob.el (org-babel-lob-ingest): Do not replace
  `org-babel-default-header-args' with
  `org-babel-default-lob-header-args'.
2016-07-24 23:26:43 +02:00
Nicolas Goaziou 7739ead8b1 ob-lob: Fix Babel call evaluation
* lisp/ob-lob.el (org-babel-default-lob-header-args): Change value.
(org-babel-lob--src-info): Ignore `org-babel-default-lob-header-args'.
(org-babel-lob-get-info): Header arguments in
`org-babel-default-lob-header-args' have precedence over those inherited
from the original source block.
2016-07-24 22:59:41 +02:00
Nicolas Goaziou d4ea5decea ob-lob: Fix docstring
* lisp/ob-lob.el (org-babel-lob--src-info): Fix typo.
2016-06-20 14:47:22 +02:00
Nicolas Goaziou a5cf0f6fb8 ob-lob: Remove `org-babel-lob-files'
* lisp/ob-lob.el (org-babel-lob-files): Remove variable.
(org-babel-library-of-babel): Fix docstring.

Since its creation, `org-babel-lob-files' has been a no-op.  Since no-one
noticed it during those 7 years, it can safely be removed.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/107824>
2016-06-20 14:47:10 +02:00
Nicolas Goaziou 8416402269 Silence byte-compiler 2016-06-17 00:24:12 +02:00
Nicolas Goaziou c3b42e917f ob: Remove `org-babel-lob-execute'
* lisp/ob-lob.el (org-babel-lob-execute): Remove function
(org-babel-lob-execute-maybe):
* lisp/ob-ref.el (org-babel-ref-resolve):
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/global/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
(test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/named-caching-call-line):
(test-ob-lob/caching-call-line):
(test-ob-lob/call-with-header-arguments): Apply removal.
2016-06-16 23:37:40 +02:00
Nicolas Goaziou dbb375fdfc Simplify Babel calls evaluation
* lisp/ob-lob.el (org-babel-default-lob-header-args): Merge value with
  `org-babel-default-header-args' since this variable is meant to
  replace the latter.
(org-babel-lob-ingest): Make sure `org-babel-default-lob-header-args' is
used instead of `org-babel-default-header-args'.
(org-babel-lob--src-info): New function.
(org-babel-lob-get-info): Use new function.  Make return value
a replacement for `org-babel-get-src-block-info'.
(org-babel-lob-execute): Use `org-babel-execute-src-block' instead of
duplicating functionalities.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply changes to
  `org-babel-lob-get-info' return value.

* testing/examples/ob-header-arg-defaults.org:
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line): Update tests.

The purpose of this commit is to make Babel calls more
predictable (e.g., wrt property inheritance) and to remove code
duplication.  Also, Babel calls results are no longer treated as Emacs
Lisp values.
2016-06-16 23:15:01 +02:00
Nicolas Goaziou e3e52a45bb ob-lob: Use lexical binding 2016-06-16 22:34:12 +02:00
Nicolas Goaziou ddd661a783 ob-lob: Use cl-lib 2016-06-16 22:34:12 +02:00
Nicolas Goaziou 94dfa7fa9c ob-lob: Improve `org-babel-lob-get-info' consistency
* lisp/ob-lob.el (org-babel-lob-get-info): Make the function on par with
  `org-babel-get-src-block-info' by providing the beginning position of
  Babel code.

(org-babel-lob-execute):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Handle new data.
2016-02-11 00:32:07 +01:00
Nicolas Goaziou 49bb05487c ob: Remove variables related to inline Babel code
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp):
(org-babel-inline-lob-one-liner-regexp):
(org-babel-lob-one-line-regexp):
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Remove variables.

(org-babel-map-inline-src-blocks):
(org-babel-map-call-lines):
(org-babel-map-executables):
(org-babel-execute-buffer):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Do not use removed variables.

Babel now mostly uses the parser to handle Babel code.  Regexps are not
needed anymore.
2016-02-10 23:50:46 +01:00
Nicolas Goaziou 33aeec4a61 Remove `org-babel-in-example-or-verbatim'
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Remove function.

* testing/lisp/test-ob.el (test-ob/combining-scalar-and-raw-result-types):
Update test.

This function is unused and inaccurate.  If needed, the parser should be
used instead.
2016-02-10 23:50:45 +01:00
Nicolas Goaziou 8865920879 ob: Remove indentation information from Babel properties
* lisp/ob-core.el (org-babel-get-src-block-info): Do not return block
  indentation.
(org-babel-parse-src-block-match): Ignore block indentation.
(org-babel-demarcate-block): Find appropriate indentation instead of
using the one from the original block.
(org-babel-where-is-src-block-result): Change signature.  Indent
according to context instead of relying on indentation from original
block.
(org-babel-insert-result): Change signature.
(org-babel-check-confirm-evaluate):
(org-babel-execute-src-block):
(org-babel-insert-header-arg): Apply change to src-block info.

* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply change to
  src-block info.

* lisp/ob-lob.el (org-babel-lob-get-info): Do not return indentation.
(org-babel-lob-execute): Apply change to lob-info.

Indentation from source block is often wrong at the block and its
results may not be in the same context.
2016-02-10 15:40:10 +01:00
Nicolas Goaziou 5f94f49db0 ob: Optimize `org-babel-lob-get-info'
* lisp/ob-core.el (org-babel-goto-named-src-block): Use parser instead
  of `org-babel-lob-one-liner-regexp'.
* lisp/ob-lob.el (org-babel-lob-execute-maybe): Ignore spurious check,
  now handled by the parser.
(org-babel-lob-get-info): Fully use parser.  Accept a new optional
argument to avoid parsing the same location twice.

* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-ref.el (org-babel-ref-resolve): Optimize call to
  `org-babel-lob-get-info'.
2016-02-10 15:40:10 +01:00
Kyle Meyer 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou 1f55456115 ob-lob: Small refactoring
* lisp/ob-lob.el (org-babel-lob-get-info): Refactor code.  Use parser to
  eschew false positives.
2015-11-26 15:13:22 +01:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Nicolas Goaziou 0d24086657 Update some copyright years 2015-02-16 01:40:07 +01:00
Aaron Ecay caad78ca8a babel: Fix bug in ‘org-babel-lob-get-info’.
* lisp/ob-lob.el (org-babel-lob-get-info): Use `save-match-data'.

Callers rely on the match data being set to
‘org-babel-lob-one-liner-regexp’.
2015-01-22 00:47:48 -05:00
Achim Gratz 9973fbc347 ob-lob: do not use cl at runtime
* lisp/ob-lob.el (org-babel-lob-execute): Do not use defun subseq from
  cl at runtime.  Replace concatenation of sub-sequences by splicing
  the modified params list into a copy of info (pre-must info be
  preserved).
2014-03-25 18:59:59 +01:00
Eric Schulte cd3bc12a29 named and caching call lines working
* lisp/ob-core.el (org-babel-current-result-hash): Additional info
  argument so that named call line results may be found.
  (org-babel-set-current-result-hash): Additional info argument so
  that named call line results may be found.
* lisp/ob-lob.el (org-babel-lob-execute): Passing info to hash finding
  functions so that named results may be found.
2014-01-18 13:40:57 -07:00
Eric Schulte 6c0992939d do not eval vars in call lines before hashing
* lisp/ob-lob.el (org-babel-lob-execute): Do not eval vars in call
  lines before hashing, because for a call lines variable
  expansion *is* evaluation.
2014-01-18 13:40:57 -07:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Bastien Guerry 62375dc3e5 Merge branch 'maint' 2014-01-03 17:16:10 +01:00
Bastien Guerry 6492b9cde4 ob-lob.el: Minor custom and docstring fixes
* ob-lob.el (org-babel-lob-files): Fix custom type.
(org-babel-lob-ingest): Small docstring fix.

Thanks to Glenn Morris for reporting them.
2014-01-03 17:15:34 +01:00
Eric Schulte 085b7e8d16 no spaces in call line names
* lisp/ob-lob.el (org-babel-inline-lob-one-liner-regexp): Don't allow
  spaces in call line function names.
2013-12-16 08:04:59 -07:00
Eric Schulte 884f5ced13 named call lines insert results like code blocks
* lisp/ob-core.el (org-babel-find-named-result): Call lines are not
  results.
  (org-babel-where-is-src-block-result): Don't implicitly name the
  results of call lines.

* lisp/ob-exp.el (org-babel-exp-non-block-elements): There is now
  another element on the call line info list.
* lisp/ob-lob.el (org-babel-lob-get-info): Return the name (if any)
  at the end of the info list.
  (org-babel-lob-execute): Pass the name through to execution.
2013-06-30 17:46:32 -06:00
Eric Schulte a79fd4be28 fix babel merge params bug from commit 693dda67
The `org-babel-params-from-properties' command was calling
  `org-babel-merge-params', the output of which was then being fed back
  to another call to `org-babel-merge-params'.  The merge params
  function is not designed to allow this form of recursive calling, and
  as a result many variables were being set to empty values.

  The first noticed side effect of this bug was the breakage of the
  org-babel-load-file command, which relies on default header
  arguments (namely :tangle), which were overwritten by the bug above.

  The fix involved having the `org-babel-params-from-properties'
  function return a list of alists, which may then all be handed to the
  top-level merge-params call.

* lisp/ob-core.el (org-babel-params-from-properties): Now returns a list
  of alists and does *not* call `org-babel-merge-params'.
  (org-babel-parse-src-block-match): Handle new list of lists output of
  `org-babel-params-from-properties'.
  (org-babel-parse-inline-src-block-match): Handle new list of lists
  output of `org-babel-params-from-properties'.
* lisp/ob-exp.el (org-babel-exp-src-block): Handle new list of lists
  output of `org-babel-params-from-properties'.
  (org-babel-exp-non-block-elements): Handle new list of lists output of
  `org-babel-params-from-properties'.
* lisp/ob-lob.el (org-babel-lob-execute): Handle new list of lists
  output of `org-babel-params-from-properties'.
2013-06-20 09:53:56 -06:00
Eric Schulte c3711b14d6 org-babel-current-exec-src-block-head -> org-babel-current-src-block-location
* lisp/ob-core.el (org-babel-current-src-block-location): Rename
  org-babel-current-exec-src-block-head to
  org-babel-current-src-block-location.
(org-babel-execute-src-block): Rename
  org-babel-current-exec-src-block-head to
  org-babel-current-src-block-location.
* lisp/ob-exp.el (org-babel-exp-results): Rename
  org-babel-current-exec-src-block-head to
  org-babel-current-src-block-location.
* lisp/ob-lob.el (org-babel-lob-execute): Rename
  org-babel-current-exec-src-block-head to
  org-babel-current-src-block-location.
2013-06-08 13:19:38 -06:00
Eric Schulte 5dc5143578 inline sets org-babel-current-exec-src-block-head
* lisp/ob-lob.el (org-babel-lob-execute): Set the
  org-babel-current-exec-src-block-head variable when executing inline
  or lob style code.
2013-06-06 10:59:27 -06:00
Carsten Dominik a84c01642b Fix customization types of variables
* contrib/lisp/org-wl.el (org-wl-namazu-default-index): Fix custom type.
* lisp/ob-lob.el (org-babel-lob-files): Fix custom type.
* lisp/org-agenda.el (org-agenda-export-html-style):
(org-agenda-ndays):
(org-agenda-inactive-leader):
(org-agenda-day-face-function):
(org-agenda-auto-exclude-function): Fix custom type.
* lisp/org-bibtex.el (org-bibtex-prefix): Fix custom type.
* lisp/org-clock.el (org-clock-heading-function):
(org-show-notification-handler): Fix custom type.
* lisp/org-footnote.el (org-footnote-auto-adjust): Fix custom type.
* lisp/org-protocol.el (org-protocol-default-template-key): Fix custom type.
* lisp/org.el (org-make-link-description-function):
(org-link-translation-function):
(org-link-frame-setup):
(org-refile-target-verify-function):
(org-get-priority-function):
(org-use-fast-tag-selection):
(org-columns-modify-value-for-display-function):
(org-sparse-tree-default-date-type): Fix custom type.
* lisp/ox-html.el (org-html-postamble):
(org-html-postamble-format):
(org-html-preamble-format): Fix custom type.
* lisp/ox-odt.el (org-odt-content-template-file): Fix custom type.
* lisp/ox.el (org-export-with-archived-trees):
(org-export-initial-scope): Fix custom type.

Thanks to Glenn Moris for reporting these.  He used cus-test.el
to find them.
2013-05-09 15:19:02 +02:00
Achim Gratz 56bf3d7891 Babel: avoid superfluous confirmation for internal wrapper
* lisp/ob-exp.el (org-babel-exp-results): Suppress user confirmation
  of the emacs-lisp wrapper execution around a lob call.

* lisp/ob-lob.el (org-babel-lob-execute): Suppress user confirmation
  of the emacs-lisp wrapper execution around a lob call.
2013-04-13 08:06:58 +02:00
Bastien Guerry 78567ef2d3 Silent compiler warning 2013-04-11 00:53:24 +02:00
Eric Schulte 58d601979c include default elisp header args in call lines
Because in actuality the call line expands to an Emacs Lisp code
  block.

* lisp/ob-lob.el (org-babel-lob-execute): Include default elisp header
  args in call lines.
2013-04-07 07:16:08 -06:00
Bastien Guerry 0284bc9d4d ob-lob.el (org-babel-lob-execute): Rename cache? to cache-p
* ob-lob.el (org-babel-lob-execute): Rename cache? to cache-p.

Thanks to Achim for pointing this.
2013-02-27 10:24:04 +01:00
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Eric Schulte ff0081847c requiring ob now pulls in all of Babel 2012-12-12 10:48:56 -07:00
Bastien Guerry 5c762bbdc6 Remove some autoloads and clean up code.
* org.el (turn-on-orgtbl): Moved here from org-table.el.
(org-clock-persistence-insinuate): Moved here from org-clock.el.
(org-update-all-dblocks, org-map-entries)
(org-require-autoloaded-modules, org-forward-element)
(org-backward-element, org-up-element)
(org-element-greater-elements, org-drag-element-backward)
(org-drag-element-forward, org-mark-element)
(org-narrow-to-element, org-transpose-element)
(org-unindent-buffer): Don't autoload.

* org-clock.el (org-clock-get-clocktable): Rename from
`org-get-clocktable'.
(org-clock-persistence-insinuate): Move to org.el.

* org-capture.el: Do no set `generated-autoload-file' locally.
Minor code clean up.

* org-agenda.el (org-agenda-list): Use
`org-clock-get-clocktable'.  Do no set
`generated-autoload-file' locally.

* org-table.el (org-table-iterate-buffer-tables): Minor
reformatting.
(turn-on-orgtbl): Move to org.el.

* org-html.el (org-export-htmlize-generate-css): Don't autoload.

* org-timer.el (org-timer-pause-or-continue, org-timer-stop):
Ditto.

* ob-tangle.el (org-babel-tangle-lang-exts): Ditto.

* ob-lob.el (org-babel-lob-ingest): Ditto.

* org-id.el (org-id-copy)
(org-id-get-with-outline-path-completion)
(org-id-get-with-outline-drilling): Ditto.

* org-lparse.el (org-lparse-and-open, org-lparse-batch)
(org-lparse-to-buffer, org-replace-region-by)
(org-lparse-region): Ditto.

* org-mobile.el (org-mobile-create-sumo-agenda): Ditto.
2012-10-02 10:03:15 +02:00
Bastien Guerry e4c31cf98b Use generated-autoload-file: "org-loaddefs.el" as a local variable. 2012-10-02 08:50:46 +02:00