* lisp/oc-basic.el (org-cite-basic--print-bibtex-string): New function
approximately parsing Bibtex strings and dropping {...}.
(org-cite-basic--print-entry): Use the new function.
* testing/examples/Basic.bib:
*
testing/lisp/test-oc-basic.el (test-org-cite-basic/export-bibliography):
Add test.
Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
Link: https://orgmode.org/list/CAF+0kSg8O3RQBG1wXoHjMEHwnGFz0gaDkTTSGv+ZaOt4d4myCA@mail.gmail.com
* lisp/org-agenda.el (org-agenda-add-time-grid-maybe): Let-bind
`org-agenda-default-appointment-duration' to nil when formatting the
grid lines. Otherwise, `org-agenda-format-item' logic fails to
produce the expected result.
* testing/lisp/test-org-agenda.el (test-org-agenda/time-grid): Add new
test set covering the bug and several simpler cases.
* testing/examples/agenda-file2.org (two): New test file example.
Reported-by: Detlef Steuer <steuer@hsu-hh.de>
Link: https://orgmode.org/list/87edv5fv1w.fsf@localhost
* (org-babel-header-args:maxima): Document the two new header
arguments (batch and graphics-pkg) that are specific to ob-maxima.
* (org-babel-maxima--command-arguments-default): A new variable
storing the default command-line argument(s). This value was
hard-coded in `org-babel-maxima:execute'.
* (org-babel-maxima--graphic-package-options): A new variable that
stores an alist of Maxima graphics packages and the Maxima code to set
up that package.
* (org-babel-maxima--default-epilogue): A new variable that stores an
alist of the clean-up code that is run at end of a `graphical-output'
or `non-graphical-output' source block.
* (org-babel-maxima--output-filter-regexps): A new variable that
stores a list of regexps to identify "bad" output lines to be removed
from Maxima's output. Source-code comments document each regexp's
purpose. Two additional regexps have been added: one filters
un-wanted output from `batch' and the other removes empty input lines
that `batch'-ed output may spuriously produce (actual empty input
lines are syntax errors, see the new tests below).
* (org-babel-maxima--output-filter): A new function that takes a
single line of Maxima output. It returns nil if the line has zero
length or matches a regexp in
`org-babel-maxima--output-filter-regexps'; otherwise, it returns the
line. This function and regexp replace the hard-coded filter in
`org-babel-execute:maxima'.
* (org-babel-maxima-expand): Prepare the source block for execution,
depending on whether it is producing graphical output or not. In case
of graphical output, use the `graphics-pkg' header to set the graphics
package and use `org-babel-maxima--graphic-package-options' to set-up
the package. Grovel the graphics terminal from the output filename.
* (org-babel-execute:maxima): Use the :batch header argument and
`org-babel-maxima--command-arguments-default' to execute the source
block. Replace the existing, in-line output filter and its regexps
with `org-babel-maxima--output-filter' and
`org-babel-maxima--output-filter-regexps'.
* testing/examples/ob-maxima-test.org: Add test examples.
Include examples of the batch-related tests from
testing/lisp/test-ob-maxima.el. Provide an example of the
`:graphics-pkg' header argument with the `draw' package.
* testing/lisp/test-ob-maxima.el: Introduce six new, batch-related
test functions. Each test exercises the :batch header argument. The
response to unusual inputs is tested (empty strings, strings with just
whitespace, input with the `:lisp' reader, and two syntax-related
errors).
link: https://list.orgmode.org/87cyz1ivzw.fsf@t14.reltub.ca/
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties. The functions are `setf'-able.
Update all the relevant code in Org to use the new functions instead
of genetic property queries.
* lisp/oc.el (org-cite-list-bibliography-files): When the bibliography
path is relative to the exported file location, keep the path
relative. Resolve relative paths for bibliographies from SETUPFILE as
well.
* testing/lisp/test-oc.el (test-org-cite/list-bibliography-files):
* testing/examples/sub-bib/include-relative-bib.org:
* testing/examples/sub-bib/include-global-bib.org: New test.
Link: https://orgmode.org/list/CAO48Bk_upR4h-xd0YL+FxeKtWvDoqH+Eju6F_Vzds_m6oxBKcg@mail.gmail.com
* lisp/ob-table.el (org-sbe): Allow quoting string values of variables
with "$". Update the docstring.
* testing/lisp/test-ob-table.el (test-ob-table/sbe): Add test. Do not
use `org-test-at-id' in favor of more illustrative
`org-test-with-temp-text'. The latter does not force users to search
the ID in reference Org file.
* testing/examples/babel.org (calling code blocks from inside table):
Remove unused example.
Reported-by: 赵一宇 <zhyznd@163.com>
Link: https://orgmode.org/list/40651be0.3e3b.1867971e644.Coremail.zhyznd@163.com
* testing/examples/ob-shell-test.org: Delete file
File was used by test-ob-shell.el to test ob-shell.el. Tests have
been updated to use temporary buffers, rendering ob-shell-test.org
unnecessary.
* testing/examples/ob-shell-test.org: Delete file
File was used by test-ob-shell.el to test ob-shell.el. Tests have
been updated to use temporary buffers, rendering ob-shell-test.org
unnecessary.
* lisp/ob-octave.el (org-babel-execute:octave):
-Ensure that the special Octave variable `ans' is bound when
GFX-FILE is non-nil. The glue code in
ORG-BABEL-OCTAVE-WRAPPER-METHOD causes Octave to exit with a
non-zero exit code when `ans' is not bound.
-Change format control string to %S from %s. Ensure the graphics
filename is quoted. If it is not, Octave may create a mis-named
file or fail entirely.
* testing/examples/ob-octave-test.org:
Update the Graphical tests section:
-put in the correct headers;
-add a remark about where to find each test.
* testing/lisp/test-ob-octave.el:
Add the three tests ob-octave/graphics-file,
ob-octave/graphics-file-session and ob-octave/graphics-file-space.
-ob-octave/graphics-file: The first test verifies that the first bug
identified above is fixed; it also verifies that graphics file
creation works correctly for scripting.
-ob-octave/graphics-file-session: The second test verifies graphics
file creation works correctly for sessions. The Octave command
`crash_dumps_octave_core(0)' is included to prevent the creation of
a core file (`octave-workspace').
-ob-octave/graphics-file-space: The third test verifies that a
graphics filename with a space in it is created correctly.
Thanks to Ihor Radchenko for helpful feedback.
Ref: https://list.orgmode.org/8735asbtfe.fsf@localhost/T/#u
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.
* 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
* 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
* 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.
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.
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.
* 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.
* 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
* 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.
* 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.
* 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.