* lisp/ob-java.el(org-babel-default-header-args:java): Add :dir
default.
(org-babel-execute:java): Check for existence of :dir in params using
alist-get instead of assq because we want a nil cdr to be false.
* testing/lisp/test-ob-java.el
(ob-java/simple, ob-java/simple-with-bracket)
(ob-java/simple-with-quote, ob-java/simple-return-int)
(ob-java/simple-return-float, ob-java/simple-return-string)
(ob-java/simple-with-main, ob-java/simple-with-two-methods)
(ob-java/simple-with-no-main, ob-java/simple-with-main-args-array)
(ob-java/simple-with-main-whitespace, ob-java/simple-with-class)
(ob-java/simple-with-non-public-class)
(ob-java/simple-with-class-and-package)
(ob-java/simple-with-class-attr)
(ob-java/simple-with-class-attr-with-package, ob-java/one-arg)
(ob-java/args-quoted-string, ob-java/integer-var)
(ob-java/var-with-main, ob-java/var-with-class)
(ob-java/var-with-class-and-package)
(ob-java/var-with-class-and-hanging-curlies, ob-java/two-vars)
(ob-java/string-var, ob-java/multiline-string-var)
(ob-java/return-vector-using-list, ob-java/return-vector-using-array)
(ob-java/read-return-list, ob-java/read-list-return-array)
(ob-java/read-return-list-with-package)
(ob-java/output-list-with-spaces, ob-java/list-var, ob-java/vector-var)
(ob-java/matrix-var, ob-java/matrix-var-with-header)
(ob-java/output-table-with-header, ob-java/inhomogeneous_table)
(ob-java/import_library, ob-java/import_library_inline)
(ob-java/tangle): Set :dir to nil to prevent tests from writing files
outside of temporary directory.
(ob-java/tangle-with-package, ob-java/simple-dir):
(ob-java/simple-dir-with-package): Move :dir param to be consistent
with other tests.
Most languages write tempfiles to babel's temporary directory, but
ob-java originally had to write them to the current directory instead.
I suspect this is because java puts the source file in package
directories, and babel doesn't expect subdirectories in the babel
temporary directory. This change brings back the original behavior.
Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
Ref: https://orgmode.org/list/87mtzk9n30.fsf@iki.fi
* lisp/org-agenda.el (org-agenda-archives-mode): Turn archive mode off
if with-files in non-nil but files are already included so that a
repeated `vA` can toggle in the same manner as a repeated `va`.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Ref: https://orgmode.org/list/87o8jxz5hu.fsf@gmail.com
* lisp/org.el: Allow users to include 'subtitle in
`org-hidden-keywords' to hide #+SUBTITLE: keyword.
This way #+SUBTITLE is treated like similar keywords for title, date,
e-mail, and author.
* lisp/ob-java.el (org-babel-java--package-re)
(org-babel-java--imports-re, org-babel-java--class-re)
(org-babel-java--main-re, org-babel-java--any-method-re):
Updated regexps to allow for more whitespace in the content of java
code blocks. Convert regexps to `rx' to improve clarity.
* testing/lisp/test-ob-java.el (ob-java/simple-with-main-whitespace):
Added test case with excessive whitespace.
Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
Ref: https://orgmode.org/list/87o8k68w05.fsf@iki.fi
* lisp/ob-java.el (org-babel-expand-body:java): The code was checking
for existence of a class declaration before wrapping the content of
the code block in a main method, but it should be checking for
existence of a main method.
* lisp/ox-odt.el (org-odt--image-size): Drop unnecessary `function'
call around `lambda'.
The previous commit from Emacs removed a (function (lambda ...))
instance immediately above. Do the same here.
* lisp/org/ox-odt.el (org-odt--image-size): Don't quote lambdas.
Don't quote lambdas in several places
61dca6e92ac972b832e889fbeab9b6131fc896fa
Stefan Kangas
Sat Nov 14 17:04:23 2020 +0100
* lisp/org-element.el (org-element-parse-secondary-string):
Don't set buffer-local variables buffer-file-name and buffer-file-truename
in temporary buffer.
Don't set file name variable in org-element-parse-secondary-string (bug#44524)
79d04ae13ff33a93f631061d912168e9703251dd
Juri Linkov
Tue Nov 10 21:27:37 2020 +0200
* lisp/org-agenda.el (org-agenda--get-buffer-name): New function.
(org-agenda-list): Move buffer name logic to shared function.
(org-search-view):
(org-todo-list):
(org-tags-view): Use org-agenda--get-buffer-name.
* testing/lisp/test-org-agenda.el
(test-org-agenda/sticky-agenda-name): Add test.
The different agenda commands repeat similar logic for determining the
buffer name, mixing in a tailored sticky buffer format. However, only
org-agenda-list falls back to "*Org Agenda*" when org-agenda-sticky is
nil. As a result, a buffer generated with org-follow-timestamp-link,
which gets a custom name, is not reset when commands other than
org-agenda-list generate a new agenda.
Move the logic from org-agenda-list to a helper function and use it
across the agenda-generating commands.
Reported-by: Garjola Dindi <garjola@garjola.net>
Ref: https://orgmode.org/list/87tuuj4lo9.fsf@pc-117-162.ovh.com
* lisp/org-faces.el (org-document-info):
(org-document-info-keyword): Rework the docstrings to follow the Elisp
convention of using a standalone summary line.
* lisp/org.el: The #+SUBTITLE: keyword is now displayed with
`org-document-info-keyword' and its value with
`org-document-info' (instead of `org-meta-line').
* lisp/org-faces.el (org-document-info):
(org-document-info-keyword): Update docstrings to include #+SUBTITLE:.
Like the title, author, e-mail, date, the subtitle is information
that is displayed in the exported document, not meta information.
* lisp/org.el (org--hide-drawers): New internal function consolidating
logic from two places currently.
(org-cycle-hide-drawers): Hide drawers before first headline at
appropriate times. Refactor to use new internal function
`org--hide-drawers'.
(org-hide-drawer-all): Refactor to use new internal function
`org--hide-drawers'.
Since this is about performance, a benchmark before this change, on a
set of 519 files with total size of 1500 kb gives the following result:
519 files scanned, 504 files contains IDs, and 911 IDs found.
(168.243948 38 2.053949000000003)
After the change the following result:
519 files scanned, 504 files contains IDs, and 911 IDs found.
(3.034806 3 0.16445799999999622)
Benchmark done on a a Windows machine with no files previously loaded
into Emacs.
* lisp/org-id.el (org-id-update-id-locations): This function has
gotten a bit of back and forth changes in terms of performance. One
year ago in 9865e6bd8 and then six months ago in 37a5020bb.
Unfortunately the latest speedup actually was a speed-down. Speed is
not good again.
* lisp/ob-java.el (org-babel-default-header-args:java): Change the
default to scripting mode.
* testing/lisp/test-ob-java.el: Modify the first test to use the
default for `:results' and all others to specify it.
A recent commit added functional mode and made it default, but this
would break java source blocks for anyone that relied on the old
default. This sets the default back to scripting mode.
* lisp/ob-exp.el (org-babel-exp-results): Fix a regression from v9.0
that led to silently executing lob calls on export despite a non-nil
value of org-confirm-babel-evaluate.
* testing/lisp/test-ob-lob.el (test-ob-lob/confirm-evaluate): New test.
56bf3d789 (Babel: avoid superfluous confirmation for internal wrapper,
2013-04-10) let-bound org-confirm-babel-evaluate to nil in two spots
to prevent double querying for lob calls. These overrides were no
longer needed following the refactoring in dbb375fdf (Simplify Babel
calls evaluation, 2016-06-16). However, that commit dropped only one
of the spots, and, as a result, disabled confirmation unconditionally
when exporting lob calls.
Drop the remaining org-confirm-babel-evaluate override.
Reported-by: 吴锐扬 <ywwry66@gmail.com>
Ref: https://orgmode.org/list/5362C0A0-632F-4C87-8FA1-915F0F53D8B8@gmail.com
* lisp/ob-java.el: Use customizable variables for java compiler and
runtime commands. Move variable declarations to fix byte-compile
warnings. Change Author. Change tabs to spaces.
A recent patch replaced `defcustom' with `defvar' for variables that
point to the java compiler and runtime commands, which would break
functionality for anyone who had customized the variable. This
reverts that change.
ob-java is using features not available on older versions of emacs
which org supports. This replaces them with alternatives.
* lisp/ob-java.el: Add support for variables and return values. Write
tempfiles to the `org-babel-temporary-directory'. Make package,
class, and main method definitions optional.
* testing/lisp/test-ob-java.el: Add tests.
ob-java was missing features common to many other org-babel
implementations, such as the ability to accept variables and return a
value. This brings those features to ob-java, making the experience
more consistent across org-babel languages, and expanding the ways
java source blocks interact with org mode buffers.
A simple java program requires boilerplate code to declare a class and
main method. This boilerplate code makes java source blocks more
tedious to write and more effort to read. This is more evident in an
org buffer where there may be many small source blocks. This change
makes that code optional. If it is not provided, the source block
will be wrapped in the boilerplate code just before compilation.
Most org babel implementation write temporary files to the
`org-babel-temporary-directory'. That avoids polluting the current
directory and provides built-in support for tramp. ob-java would
write source files and binaries to the directory containing the org
file by default. This may be unexpected and unwanted, and didn't work
with tramp. This change writes all tempfiles to the
`org-babel-temporary-directory'.
Executing an ob-java source block would always try to compile and run
the code in the source block, so a source block that wasn't
runnable (didn't contain a main method) would error during run. This
change adds a generic main method just before compilation if one isn't
included in the source block so that the run will succeed.
There were no tests for ob-java. This adds tests.
* lisp/ob-python.el (org-babel-python--exec-tmpfile): Rename tmpfile handle
(org-babel-python-format-session-value): Rename tmpfile handle
Opening the exec tmpfile as a `f' variable shadows any such variable
that might by defined by the Python session context. e.g. my Org babel
files commonly pass single letter variables inside a session which is
broken by this behavior.
The new name `__org_babel_python_tmpfile' is in line with other org
mode specific Python variables set by ob-python. This is unlikely to
conflict with the user's Python code.
TINYCHANGE