aboutsummaryrefslogtreecommitdiffstats
path: root/testing/examples (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test-org-fold.el: Add test for inline image displaying when cyclingstardiviner2022-10-261-0/+0
| | | | | * testing/lisp/test-org-fold.el (test-org-fold/org-fold-display-inline-images): Add unit test for inline image displaying when cycling.
* ob-sed-test: Make the tests pass on BSD systems, such as macOSRudolf Adamkovič2022-10-071-1/+4
| | | | * testing/examples/ob-sed-test.org: Fix BSD sed incompatibility
* ob-C: do not swallow double quotes on raw outputThierry Banel2022-09-271-0/+12
| | | | | | | | | | * lisp/ob-C.el (org-babel-C-execute): Remove the erroneous call to `org-babel-read' when output is raw. * testing/examples/ob-C-test.org (Output), testing/lisp/test-ob-C.el (ob-C/ouput-doublequotes): Add a test with double quotes output. https://list.orgmode.org/orgmode/bc004962-679e-498f-b245-ae253aae6271@www.fastmail.com/
* testing: Make all files use `lexical-binding`Stefan Monnier2022-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mainly, add the corresponding cookie, but also add various `require`s so that the compiler knows which vars should be trated as dynbound. This does not fix all the warnings, but does try to eliminate all those about "unused" variables. For the variables truly unused, the patch usually adds an underscore to their name to silence the warning. Some of the fixes affect files which already used `lexical-binding`. Not sure why the test worked before: maybe because the tests were run without compiling them first (which could cause some of the missing `require`d packages to be autoloaded before we got to the problematic code, thus hiding the problem)? I found some suspicious code, for which I added FIXMEs. There are also a few changes to the main files. * lisp/org-protocol.el (org-protocol-check-filename-for-protocol): Don't call `server-edit` if it's not yet defined. [ Needed to get the tests to pass. ] * lisp/ob-core.el (org-babel-temporary-directory) (org-babel-temporary-stable-directory): Always define (and use nil if we don't want to create a directory for it). Simplify the code based on the fact that (defvar V E) only evaluates E if V is not yet `boundp`. (org-babel-temp-file, org-babel-temp-stable-file) (org-babel-remove-temporary-directory) (org-babel-remove-temporary-stable-directory): Adjust accordingly. * lisp/org.el (org-log-beginning): Add FIXME. * testing/org-test.el: Require `org` and `org-id`. (org-id-locations-file): Don't `defconst` it. (org-test-at-id, org-test-in-example-file, org-test-at-marker) (org-test-with-temp-text, org-test-with-temp-text-in-file): Move edebug specs into `declare` (and simplify them). (org-test-with-tramp-remote-dir--worker): Declare dynbound tramp vars. (org--compile-when): Fix quoting of `exp`. (org-test-load): Tweak regexps. * testing/org-batch-test-init.el: Tweak regexp, remove dead code and add a FIXME about it. * testing/lisp/test-ox.el: Require `ox` instead of erroring out if it's not already loaded. Also require `org-inlinetask`. (org-test-with-parsed-data): Silence warnings when `info` is not used. (test-org-export/bind-keyword): Add FIXME. * testing/lisp/test-ox-publish.el: Require `org-test` and `ox-publish`. (test-org-publish/resolve-external-link): Expose lambdas to the compiler. Remove unused var `ids`. (test-org-publish/get-project-from-filename): Remove unused var `file`. * testing/lisp/test-org.el: Require `org-macs`, `org`, `org-inlinetask`, `org-refile`, and `org-agenda`. (test-org/org-read-date): Declare `org-time-was-given` as dynbound. (test-org/set-regexps-and-options): Add FIXME. * testing/lisp/test-org-timer.el: Require `org-timer`. * testing/lisp/test-org-table.el: Require `ox`. * testing/lisp/test-org-protocol.el: Require `org-protocol` instead of erroring out if it's not already loaded. Also require `capture`, and add missing `provide` statement. * testing/lisp/test-org-pcomplete.el: Require `org`. * testing/lisp/test-org-list.el: Require `org-list` and `org`. * testing/lisp/test-org-lint.el: Require `org-footnote` and `org-lint`. * testing/lisp/test-org-footnote.el: Require `org-footnote`. * testing/lisp/test-org-element.el: Require `org-element` instead of erroring out if it's not already loaded. Also require `org` and `org-inlinetask`. * testing/lisp/test-org-duration.el: Require `org-duration`. * testing/lisp/test-org-datetree.el: Require `org-datetree`. * testing/lisp/test-org-colview.el: Require `org-colview`, `org-duration`, and `org-inlinetask`. * testing/lisp/test-org-clock.el: Require `org-duration` and `org-clock`. * testing/lisp/test-org-archive.el: Require `org-archive`. * testing/lisp/test-org-agenda.el (test-org-agenda/bulk-custom-arg-func): Add FIXME. * testing/lisp/test-ol.el: Require `ol` and `org-id`. (test-org-link/store-link): Declare `org-store-link-props` and add FIXME. * testing/lisp/test-oc.el (test-org-cite/export-capability): Add FIXME. * testing/lisp/test-ob.el: Require `ob-core`, `org-src`, `ob-ref`, and `org-table`. (test-ob/eval-header-argument): Rename `foo` to `test-ob--foo` and declare it as dynbound. (test-ob/blocks-with-spaces, test-ob/specific-colnames): Add FIXME. (test-ob/noweb-expansions-in-cache): Declare `noweb-expansions-in-cache-var` as dynbound. * testing/lisp/test-ob-tangle.el: Require `org` and `ob-tangle`. * testing/lisp/test-ob-shell.el: * testing/lisp/test-ob-python.el: Require `ob-core`. * testing/lisp/test-ob-lob.el: Require `ob-lob`. (temporary-value-for-test): Declare as dynbound. * testing/lisp/test-ob-plantuml.el: Require `ob-plantuml` instead of erroring out if it's not already loaded. * testing/lisp/test-ob-lilypond.el: Require `ob-lilypond` instead of erroring out if it's not already loaded. Use `with-current-buffer`. * testing/lisp/test-ob-julia.el: Require `ob-core`. * testing/lisp/test-ob-java.el (org-babel-temporary-directory): Remove dead code now that `org-babel-temporary-directory` is always bound. * testing/lisp/test-ob-exp.el: Require `ob-exp`, `org-src`, and `org-test`. (ob-exp/evaluate-all-executables-in-order): Declare `*evaluation-collector*` as dynbound. * testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/dynamic-lexical-edit) (ob-emacs-lisp/dynamic-lexical-execute): Rename dynbound var to `ob-emacs--x` and declare it as such. * testing/lisp/test-ob-R.el: Require `ob-core`. (ess-ask-for-ess-directory, ess-history-file): Declare vars.
* org-agenda: Fix regression when diary sexp timestamps are ignoredIhor Radchenko2022-03-261-0/+4
| | | | | | | | * lisp/org.el (org-at-timestamp-p): Return non-nil on sexp timestamps when called with 'agenda argument. * testing/examples/agenda-file.org (test sexp timestamp inside properties): * testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp): Add new test checking sexp timestamp inside properties drawer.
* org-agenda: Match timestamps inside node propertiesIhor Radchenko2022-03-221-0/+4
| | | | | | | | | | | | | | | * lisp/org-agenda.el (org-agenda-get-timestamps): Use `org-at-timestamp-p' instead of org-element to check if at valid timestamp. Agenda should consider timestamps inside node properties even though they are not parsed by org-element. * testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp): Add new test checking active timestamp inside property drawer. * testing/examples/agenda-file.org (test timestamp inside properties): Add heading for `test-org-agenda/property-timestamp'. Reported in https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com
* test-org-agenda: Test for scheduled-looking linesIhor Radchenko2022-01-121-0/+10
| | | | | | | | | | | * testing/examples/agenda-file.org: Add test headings where SCHEDULED line is not planning. * testing/lisp/test-org-agenda.el (test-org-agenda/non-scheduled-re-matces): Make sure that SCHEDULED lines that do no belong to planning do not trigger agenda matches. See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t
* ob-C.el: Fix missing C, C++ declarationtbanelwebmin@free.fr2021-01-141-1/+1
| | | | | | | | * lisp/ob-C.el (org-babel-C-utility-header-to-C): Add declaration of strcmp() for C and C++. * testing/examples/ob-C-test.org (Simple tests): Remove a spurious \n new line.
* Fix tests wrt 2f53429413Bastien2020-09-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | * testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1) (test-ob/just-one-results-block) (test-ob/org-babel-remove-result--results-default) (test-ob/specific-colnames): Fix tests. * testing/lisp/test-ob-tangle.el (ob-tangle/comment-links-at-left-margin): Ditto. * testing/lisp/test-ob-shell.el (ob-shell/generic-uses-no-arrays) (ob-shell/bash-uses-arrays) (ob-shell/generic-uses-no-assoc-arrays) (ob-shell/bash-uses-assoc-arrays, ob-shell/simple-list): Ditto. * testing/lisp/test-ob-exp.el (ob-exp/exports-inline) (ob-exp/exports-inline-code): Ditto. * testing/examples/ob-shell-test.org (Generic shell: no arrays) (Bash shell: support for arrays) (Generic shell: no special handing) (Bash shell: support for associative arrays) (Generic shell: no special handing) (Bash shell: support for associative arrays with lists): Ditto.
* Add test case for symbol coercion in C Babel blocksKévin Le Gouguec2020-05-281-0/+6
| | | | | | | | | | | | | | | The ORG-NEWS entry for version 9.1 suggests that this coercion was always intended, though AFAICT there was no test case for it. * testing/lisp/test-ob-C.el (ob-C/symbol-include): Check explicitly that :includes <iostream> (with no double-quotes around <iostream>) will be parsed correctly. (ob-D/simple-program, ob-C/integer-var, ob-D/integer-var, ob-C/two-integer-var, ob-D/two-integer-var, ob-C/string-var, ob-D/string-var, ob-C/preprocessor): Adjust block indices. * testing/examples/ob-C-test.org (Simple tests): Add input for the new test.
* Fix `org-babel-detangle' handling of false positivesKevin J. Foley2020-05-242-0/+18
| | | | | | | | | | | | | | * lisp/ob-tangle.el (org-babel-detangle): Handle false positive matches of `org-link-bracket-re'. * testing/examples/babel.el: New file for Babel detangle false positive test. * testing/examples/babel.org (detangle): Add detangle/false positive example. * testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive): Add test for detangle false positive.
* Merge branch 'master' into nextKyle Meyer2019-11-161-2/+2
|\
| * Fix typosJonas Bernoulli2019-11-161-2/+2
| |
* | Org document property-drawersGustav Wikström2019-10-191-2/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functionality to define property-blocks on document level, in addition to at headline level. * doc/org-manual.org: * etc/ORG-NEWS: Document new functionality. * lisp/org.el (org-keyword-regexp): Define constant instead of hardcoding. (org-file-properties): Renamed, see next line. (org-keyword-properties): Renamed from above. Due to the fact that properties can be defined for the whole document using property drawers this local variable needs a rename to make its name less ambigous. (org-refresh-properties, org-refresh-property, org-entry-properties) (org-refresh-category-properties, org-get-property-block) (org-entry-get-with-inheritance, org-entry-put) (org-insert-property-drawer, org-end-of-subtree): Made to work before first headline. (org-at-property-block-p): New function to validate if point is at the start of a property block. (org-property-global-value): Renamed, see next line. (org-property-global-or-keyword-value): Renamed from above to match its functionality better. (org-back-to-heading-or-point-min): New function to make a document work as a level 0 node in the outline. (org-at-keyword-p): Predicate function to answer to if we're currently at a keyword line or not. (org-up-heading-or-point-min): New function to make a document work as a level 0 node in the outline. * lisp/org-element.el (org-element--current-element): Can now detect property-blocks before first headline according to it's positional rules. * lisp/org-attach.el (org-attach): Make it possible to call the attachment dispatcher also before the first headline, since document property drawers make attachments possible for the whole document now. * lisp/org-capture.el: Modified only due to rename of function in org.el. * lisp/org-compat.el (org-file-properties) (org-property-global-value): Renamed functions declared obsolete. * testing/lisp/test-org.el (org/insert-property-drawer) (org/set-property, org/delete-property, org/delete-property-globally): Additions of tests to check if they work before first headline. (org/at-property-p, org/at-property-block-p, org/get-property-block) (org/entry-get, org/refresh-properties): New tests * testing/examples/property-inheritance.org: Switch from property-keywords to a property-drawer in the testfile. Functionality should be the same, but now using a document drawer instead of property-keywords. Reason for switching is that I'd like us to slowly depricate property-keywords. * testing/lisp/test-org-element.el: * contrib/lisp/ox-taskjuggler.el: A comment is modified only due to rename of function in org.el.
* org-attach*, org, org-manual, org-news, ox-html, testing/*Gustav Wikström2019-07-076-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/org-attach.el Changed the way attachments deal with property-inheritance. It now adheres to the =org-use-property-inheritance= setting by default but it can be customized if needed (I recommend to enable it!). The property ATTACH_DIR is deprecated in favour of the shorter and simpler property DIR. Added an explicit option to =org-attach= for unsetting attachment-directories (i.e. remove DIR property and deal with the attachments by interaction). Added attachment link type with the prefix "attachment:". Added customizations: - org-attach-dir-relative - org-attach-preferred-new-method - org-attach-use-inheritance - org-attach-id-to-path-function Hooks added: - org-attach-after-change-hook - org-attach-open-hook A new linktype "attachment" is added in order to reduce link-duplication when wanting to link to files in attached folders of nodes. This works for both ID and DIR properties. The goal is to make the functionality for attachment links mirror the functionality for file links. * lisp/org-attach-git.el New file, existing functionality. Code here has been factored out from org-attach.el and if GIT-functionality is to be used this module needs to be required sepatately. It extends org-attach by use of its hooks. Activating git functionality in org-attach is done by loading org-attach-git from now on, instead of customizing a variable. Naming of both functions and tests has been modified to match the move of functionality into its own module. * lisp/org.el Inline images are shown also using attachment-links, exactly the same as it works for file-links today. Make org-open-at-point respect ARG when opening attachment-dir. * lisp/org-compat.el org-attach-directory has been deprecated in favour for org-attach-id-dir. The new name matches its purpose better. * lisp/ox-html.el Export attachment links to images as inline images, in the same way as file links work today. * etc/ORG-NEWS Mention the changes in this patch. * doc/org-manual.org The chapter "Refile, Copy, Archive" has been split into two separate chapters. - "Refile, Copy and Archiving" for information related to moving existing data around. - "Capture, Attachments, RSS Feeds and Protocols" for information related to working with external data. The attachment-part has been rewritten and extended to match the changes in this patch. The new attachment link type is mentioned both inside the attachments chapter and in the chapter dealing with links. Documentation related to external links has been improved. * testing/lisp/test-org-attach-annex.el Require org-attach-git instead of org-attach, since this file tests the GIT-functionality. * testing/lisp/test-org-attach.el Add tests for org-attach. * testing/org-test.el Define a symbol for a file to test attachments with. * testing/examples/* A bunch of new example files and folders are created and are used in testing of org-attach to verify its functionality.
* test-org-agenda: Test diary inclusionMarco Wahl2019-01-082-0/+3
| | | | | * testing/lisp/test-org-agenda.el (test-org-agenda/diary-inclusion): New test.
* org-agenda: New test for setting priorityDima Gerasimov2018-10-131-0/+1
| | | | | | | | | * testing/examples/agenda-file.org: Add a subnote, make sure it has no impact on agenda. * testing/lisp/test-org-agenda.el (test-org-agenda/set-priority): New test. TINYCHANGE
* Remove unnecessary `(require 'cl)'Nicolas Goaziou2018-04-291-1/+0
| | | | * testing/examples/babel.org: Remove unnecessary `(require 'cl)'.
* Mark "org-version-check" obsoleteNicolas Goaziou2018-04-291-15/+12
| | | | | | * lisp/org-compat.el (org-version-check): Mark as obsolete. (org-no-popups): * testing/examples/babel.org: Remove use of `org-version-check'.
* Merge branch 'maint'Nicolas Goaziou2018-02-152-3/+2
|\
| * Fix failing testsNicolas Goaziou2018-02-152-3/+2
| | | | | | | | | | | | | | Use relative symlinks instead of absolute ones. Reported-by: Nick Dokos <ndokos@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00241.html>
* | Merge branch 'maint'Nicolas Goaziou2018-02-132-0/+3
|\ \ | |/
| * ox-publish: Follow symlink directoriesNicolas Goaziou2018-02-132-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/org-compat.el (directory-files-recursively): Remove compatibility function, no longer needed. * lisp/ox-publish.el (org-publish--expand-file-name): (org-publish-org-to): (org-publish-collect-index): (org-publish--store-crossrefs): (org-publish-resolve-external-link): Preserve symlinks in file name. (org-publish-get-base-files): Follow symlink directories. (org-publish-get-project-from-filename): Preserve symlinks in file name. Do not use `file-in-directory-p', which ignores symlinks. Reported-by: Michel Damiens <michel.damiens@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00186.html>
* | Merge branch 'maint'Nicolas Goaziou2018-01-191-2/+2
|\ \ | |/
| * Use https for links to orgmode.orgTim Landscheidt2018-01-191-2/+2
| | | | | | | | TINYCHANGE
* | Merge branch 'maint'Nicolas Goaziou2017-12-312-2/+2
|\ \ | |/
| * Change Org-mode into Org modeNicolas Goaziou2017-12-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/ob-core.el (org-babel-result-to-file): * lisp/ob-picolisp.el: * lisp/org-agenda.el (org-check-for-org-mode): (org-search-view): (org-tags-view): (org-agenda-cleanup-fancy-diary): (org-agenda-get-day-entries): * lisp/org-table.el (orgtbl-mode): * lisp/org-w3m.el (org-w3m-copy-for-org-mode): * lisp/org.el (org-modules): (org-startup-options): (org-fontify-meta-lines-and-blocks): * mk/default.mk: * mk/manfull.pl: * mk/org-fixup.el (org-make-org-version): (org-make-org-loaddefs): * mk/orgcard2txt.pl (rep_esc): * mk/targets.mk ($(info): * testing/README: (Example): * testing/examples/no-heading.org: * testing/examples/normal.org: Change Org-mode into Org mode
* | Fix failing testNicolas Goaziou2017-11-031-0/+3
| | | | | | | | | | | | * testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link): Rewrite test to prevent race condition which could affect results. * testing/examples/pub/b.org: Add missing keyword.
* | ox-html: Prevent spurious target below headlinesNicolas Goaziou2017-09-102-1/+9
|/ | | | | | | | | | | | | | | * lisp/ox-html.el (org-html-headline): (org-html-link): Do not insert an additional target. * lisp/ox-publish.el (org-publish-resolve-external-link): Add an optional argument. * lisp/ox.el (org-export-get-reference): Improve docstring. * testing/examples/pub/a.org: * testing/examples/pub/b.org: New files. * testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link): New test.
* test-org-agenda: Non-todo-kwd scheduled item must appear in agendaMarco Wahl2017-07-191-0/+2
|
* Merge branch 'maint'Marco Wahl2017-03-171-0/+3
|\
| * org-agenda: Fix agenda standard name when going unstickyMarco Wahl2017-03-171-0/+3
| | | | | | | | | | | | | | | | | | * lisp/org-agenda.el (org-agenda-list): Reset `org-agenda-buffer-name' to the original name. * testing/lisp/test-org-agenda.el: Pertaining unit test. + 2 basic agenda tests. * testing/examples/agenda-file.org: File to produce content for an agenda to test.
* | ox-publish: Fix :base-extension (part 2)Nicolas Goaziou2016-12-292-0/+2
| | | | | | | | | | | | | | | | | | * lisp/ox-publish.el (org-publish-get-base-files): Make sure to remove directories. * testing/examples/pub/file.txt: * testing/examples/pub/noextension: New files. * testing/lisp/test-ox-publish.el (test-org-publish/base-extension): New test.
* | ox-publish: Add testsNicolas Goaziou2016-12-193-0/+9
|/ | | | | | | * testing/examples/pub/a.org: * testing/examples/pub/b.org: * testing/examples/pub/sub/c.org: * testing/lisp/test-ox-publish.el: New files.
* ob-maxima-test: Clarify matrix testMarco Wahl2016-08-201-0/+1
| | | | | * testing/examples/ob-maxima-test.org: Suppress informational output at load of numericalio. (This output made testing complicated.)
* ob-maxima-test: Tiny cleanupMarco Wahl2016-08-201-1/+1
| | | | | * testing/examples/ob-maxima-test.org: Removed superfluous source block variable.
* Remove deprecated syntax for Babel propertiesNicolas Goaziou2016-07-044-44/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/org.texi (Header arguments in Org mode properties): Remove reference to deprecated syntax. * lisp/ob-core.el (org-babel-params-from-properties): Ignore deprecated syntax. * testing/examples/babel.org: * testing/examples/normal.org: * testing/examples/ob-header-arg-defaults.org: * testing/examples/property-inheritance.org: * testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/global/noweb): (test-ob-header-arg-defaults/global/call): (test-ob-header-arg-defaults/tree/overwrite/call): (test-ob-header-arg-defaults/tree/overwrite/noweb): (test-ob-header-arg-defaults/tree/accumulate/call): (test-ob-header-arg-defaults/tree/accumulate/noweb): (test-ob-header-arg-defaults/tree/complex/call): (test-ob-header-arg-defaults/tree/complex/noweb): * testing/lisp/test-ob.el (test-ob/elisp-in-header-arguments): * testing/lisp/test-property-inheritance.el (test-org-property-accumulation-overwrite-use): Update syntax. (test-org-property-accumulation-append-use): Use new syntax. (test-org-property-accumulation-top-val) (test-org-property-accumulation-overwrite-val) (test-org-property-accumulation-append-val): Remove tests.
* Simplify Babel calls evaluationNicolas Goaziou2016-06-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ob: Remove `org-babel-get-inline-src-block-matches'Nicolas Goaziou2016-02-101-20/+0
| | | | | | | | | | | | | | * lisp/ob-core.el (org-babel-get-inline-src-block-matches): Remove function. (org-babel-when-in-src-block): (org-babel-insert-result): Do not use removed function. (org-babel-remove-inline-result): Add an optional argument for a tiny speed-up. * testing/examples/babel.org: * testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1): Remove needless tests.
* ob: Rewrite `org-babel-get-src-block-info' using parserNicolas Goaziou2016-02-101-2/+0
| | | | | | | | | | | | | | | | | | | * lisp/ob-core.el (org-babel-get-src-block-info): Rewrite function. Change signature. (org-babel-parse-src-block-match): (org-babel-parse-inline-src-block-match): Remove functions. (org-babel-execute-src-block): Remove useless function call. * lisp/ob-exp.el (org-babel-exp-process-buffer): Make use of signature change. (org-babel-exp-results): Use new return value from `org-babel-get-src-block-info'. Tiny refactoring. * testing/lisp/test-ob.el (test-ob/nested-code-block): Fix test. * contrib/lisp/org-eldoc.el (org-eldoc-get-src-lang): Use parser instead of removed function. * testing/examples/babel.org: Fix test environment.
* Replace TBLNAME with NAME in testsNicolas Goaziou2016-02-103-5/+5
| | | | | | | | | | | | * testing/examples/ob-C-test.org: * testing/examples/ob-fortran-test.org: * testing/examples/ob-maxima-test.org: * testing/lisp/test-ob-python.el (test-ob-python/colnames-yes-header-argument-again): (test-ob-python/colnames-no-header-argument-again): * testing/lisp/test-ob.el (test-ob/do-not-resolve-to-partial-names-data): Use NAME instead of TBLNAME. TBLNAME is deprecated syntax since Org 8.
* fix SETUPFILE pathname expansion with subdirectoriesRichard Hansen2015-09-243-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/org-macro.el (org-macro--collect-macros): cd to the directory containing the SETUPFILE before recursing so that relative pathnames in the SETUPFILE are expanded properly. * lisp/org.el (org--setup-collect-keywords): cd to the directory containing the SETUPFILE before recursing so that relative pathnames in the SETUPFILE are expanded properly. * lisp/ox.el (org-export--get-inbuffer-options, org-export--list-bound-variables): cd to the directory containing the SETUPFILE before recursing so that relative pathnames in the SETUPFILE are expanded properly. If /path/to/foo.org contains: #+SETUPFILE: settings/beamer.org and /path/to/settings/beamer.org contains: #+SETUPFILE: common.org then we want to read /path/to/settings/common.org, not /path/to/common.org. TINYCHANGE
* Org Babel now supports sed scriptsBjarte Johansen2015-05-301-0/+35
| | | | | | | | * doc/org.texi: Signal new babel language. * lisp/ob-sed.el: * testing/examples/ob-sed-test.org: * testing/lisp/test-ob-sed.el: New files.
* Remove default #includes in Babel C, C++Thierry Banel2015-03-311-1/+1
| | | | | | | | | | * ob-C.el (org-babel-C-expand-C): remove automatic inclusion of <string.h>, <stdio.h>, <stdlib.h> * ob-C-test.org: adjust C++ tests to manually include required header files. <http://permalink.gmane.org/gmane.emacs.orgmode/96528>
* testing/*: Inline result tests modified to follow current schemaCharles Berry2015-01-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | * test/examples/babel.org: Miscellaneous fixes for new inline src block schema. Return a scalar to avoid unwanted error. Return a raw result from `src_emacs-lisp' to make checking results cleaner than dealing with `results' macro. * testing/lisp/test-ob-exp.el: Wrap some expected results in `{{{results(' and ')}}}' and drop `=%s=' formatting of others. * testing/lisp/test-ob-lob.el: Wrap some expected results in `{{{results(' and ')}}}'. * testing/lisp/test-ob.el: Wrap some expected results in `{{{results(' and ')}}}'. * testing/lisp/test-ob.el (test-org-babel/org-babel-get-inline-src-block-matches, test-org-babel/inline-src_blk-results-silent): Tests of inline src block matches (and `org-ctrl-ctrl-c') conform to the `:begin' and `:end' properties of `org-element-context'. * testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1, test-org-babel/inline-src_blk-default-results-replace-line-2): Inline results are self replacing.
* test: Fixes for running tests interactively.Aaron Ecay2015-01-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * testing/examples/babel.org: Change spaces to dashes in #+name lines. * testing/lisp/test-ob-exp.el (org-test-with-expanded-babel-code): (ob-exp/evaluate-all-executables-in-order): (ob-exp/exports-inline-code): (ob-exp/exports-inline): (ob-exp/exports-inline-code-double-eval): (ob-exp/exports-inline-code-eval-code-once): (ob-exp/exports-inline-code-double-eval-exports-both): (ob-exp/use-case-of-reading-entry-properties): (ob-exp/export-from-a-temp-buffer): (ob-export/export-with-results-before-block): (ob-export/export-under-commented-headline): * testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines): * testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1): (test-org-babel/inline-src_blk-default-results-replace-line-2): (test-org-babel/inline-src_blk-manual-results-replace): (test-org-babel/inline-src_blk-results-scalar): (test-org-babel/inline-src_blk-results-verbatim): (test-org-babel/inline-src_blk-preceded-punct-preceded-by-point): * testing/lisp/test-ox.el (test-org-export/export-scope): Bind ‘org-babel-inline-result-wrap’ and/or ‘org-export-babel-evaluate’ so tests work when users have customized these variables. * testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block): Add ‘org-trim’ where an extra newline was creeping in. * testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments): Neutralize org-babel-insert-result, which was stomping on the buffer contents and disrupting the test * testing/lisp/test-org-element.el (test-org-element/block-switches): Replace (should (and ...)) with multiple (should ...). This gives more precise indications of what is wrong when a test fails. (test-org-element/link-parser): Require org-docview. * testing/lisp/test-org-timer.el (test-org-timer/other-timer-error): Add the error type for ‘should-error’. * testing/lisp/test-ox.el (test-org-export/set-title): (test-org-export/handle-options): (test-org-export/with-timestamps): (test-org-export/comment-tree): (test-org-export/handle-inlinetasks): Let ‘org-export-filter-body-functions’ and ‘org-export-filter-final-output-functions’ to nil where an empty string is the expected result. ‘org-export-filter-apply-functions’ treats an empty string as special, and changes it to nil. This creates test failures when the user has customized these variables. * testing/org-test.el (org-test-with-temp-text): Let ‘org-mode-hook’ to nil. (org-test-table-target-expect): Require ert since this function calls some of its should* functions.
* Add test for setup keywords initializationNicolas Goaziou2014-10-281-0/+1
| | | | | | * testing/lisp/test-org.el (test-org/set-regexps-and-options): New test. * testing/examples/setupfile.org: Add a keyword for testing.
* ox: Update INCLUDE keywords wrt property drawersNicolas Goaziou2014-10-281-3/+3
| | | | | | | | * lisp/ox.el (org-export--inclusion-absolute-lines): Fix comment. (org-export--prepare-file-contents): Do not look for property drawers after a drawer, since this is impossible. * testing/examples/include.org: Fix test data.
* ox: Allow file-links with #+INCLUDE-keywordRasmus2014-10-021-0/+25
| | | | | | | | | | | | * org.el (org-edit-special): Handle file-links for INCLUDE. * ox.el (org-export--prepare-file-contents): Handle links and add option no-heading. * ox.el (org-export-expand-include-keyword): Resolve headline links and add option :only-contents. * orgguide.texi (Include files) org.texi (Include files): Updated. * testing/examples/include.org: New examples. * test-ox.el (test-org-export/expand-include): New tests.
* ob: Support for exporting inline source codeNicolas Berthier2014-08-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/ob-exp.el (org-babel-exp-inline-code-template): New customizable variable to export inline source code (similar to `org-babel-exp-code-template'). (org-babel-exp-code): New `type' argument to differentiate between inline and standard code blocks. * lisp/ob-core.el (org-babel-inline-src-block-regexp): Allow empty set of switches and header arguments as in "src_sh[]{echo foo;}". Also permit spaces before them. * testint/lisp/test-org-element.el (test-org-element/inline-src-block-parser): Test extended syntax for inline source code. * testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): New function for testing inline source code handling. Also add three new failing tests exhibiting unexpected results with ":results code" switches. * testing/lisp/test-ob.el (test-org-babel/org-babel-get-inline-src-block-matches): Test for inline source blocks with empty header arguments. * testing/examples/babel.org: New sections for testing (i) exported inline source code (used by `ob-exp/exports-inline-code'); (ii) parsing inline source blocks with empty header arguments (used by `test-org-babel/org-babel-get-inline-src-block-matches'). Until now pieces of inline source code were handled as standard code blocks during export. These changes enable them to be exported.