* lisp/org-element.el (org-element-inline-src-block-parser): Un-escape
code in inline source blocks.
(org-element-inline-src-block-interpreter): Escape it again if
necessary.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add test.
* lisp/ox.el (org-export--parse-option-keyword): Do not stop parsing
OPTIONS keyword when an option without a value is encountered.
* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
tset.
This is a followup to 7116914427.
* lisp/ob-tangle.el (orb-babel-tangle-single-block): Regularize
behavior when removing coderefs during tangling. This fixes an issue
where trailing whitespace would be retained when coderefs were removed
for tangling.
* lisp/ox.el (org-export--parse-option-keyword): Prevent "End of
file during parsing" error when an OPTIONS item is incomplete.
* lisp/org-lint.el (org-lint-unknown-options-item): Check for
incomplete options items.
* testing/lisp/test-org-lint.el (test-org-lint/unknown-options-item):
Add test.
* lisp/ox-texinfo.el (org-texinfo--sectioning-structure): New function.
(org-texinfo-headline): Use new function.
(org-texinfo--menu-entries): Filter out headlines with no sectioning
command defined.
Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00196.html>
* lisp/org-colview.el (org-columns--compute-spec): Do not update
special properties, which are not set through property drawers.
Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00135.html>
* lisp/org.el (org-mode): Mark org-link-descriptive as buffer-local.
Calling org-toggle-link-display is an inherently buffer-local
operation because it works via the buffer-local
buffer-invisibility-spec, so toggling the global value leads to a
mismatched, invalid state in all other buffers.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Ref: https://orgmode.org/list/87lfeqzm3a.fsf@gmail.com
Reported-by: Ingo Lohmar <ingo.lohmar@posteo.net>
Ref: https://orgmode.org/list/87pmzdhl4b.fsf@kenko.localhost.com
* lisp/ox-latex.el (org-latex--protect-texttt): New function.
(org-latex--text-markup): Use new function.
(org-latex-headline): Convert any instances of \verb text with
\texttt. This is required to work around LaTeX peculiarities that
would otherwise cause compilation to fail (see the code comment for
more information).
* org-agenda.el (org-agenda-format-item): Rename parameters so they
don't clash with dynamic variables used by
`org-prefix-format-compiled'.
TINYCHANGE
* doc/org-manual.org:
* lisp/org-protocol.el: Quote emacsclient arguments
in examples to prevent interpreting of ampersands as intent
to run processes in background by bash and similar shells.
Single quotes may cause a problem with cmd.exe, so use
double quotes despite they are a bit less safe in bash and Co.
* lisp/ox-html.el (org-html-format-drawer-function): Drop leftover
text from when an example used to be included.
adcebf38f (Fix errors reported by cus-test.el, 2013-11-14) dropped the
example but left the leading part.
Reported-by: Jean-Baptiste Mazon <jmazon@gmail.com>
Ref: https://orgmode.org/list/0e5569e6-15a7-d4c4-0558-8b0ef96a515c@gmail.com
* lisp/ob-exp.el (org-babel-exp-process-buffer): Signal user-error
with an informative message rather than letting
org-babel-exp-do-export call fail due to an invalid INFO argument.
* testing/lisp/test-ob-exp.el (ob-exp/unknown-call-reference): Add
test.
Reported-by: Greg Minshall <minshall@umich.edu>
Ref: https://orgmode.org/list/628738.1616259666@apollo2.minshall.org
* lisp/org.el (org-open-file): Use 'pipe :connection-type instead of
'pty to prevent killing of background process on handler exit.
(Bug#44824)
Problem happens only in some desktop environments where configured
through `org-file-apps' or mailcap handlers launches actual viewer
(as defined in .desktop files and obtained from mimeapps.list)
in background. E.g. xdg-open invokes "gio open" or kde-open5 for Gnome
or KDE accordingly and these handlers launches e.g. eog or okular in
background. As soon as main process exits, temporary terminal session
created by `start-process-shell-command' is terminated. As a result
background processes receive SIGHUP.
Previously command were executed with no buffer, so the change
does not affect "needsterminal" and "copiousoutput" mailcap features,
they are not supported as earlier.
If handler main process fails then show a message with exit reason.
Output (including error messages) is ignored as before.
Gtk application tends to report significant amount of failed asserts
hardly informative for majority of users.
TINYCHANGE
* lisp/ox-html.el (org-html-inline-image-rules): Add webp as an inline
image format
Webp is an image format introduced in 2010, which now has widespread
support in browsers. ox-html can inline webp images identically to how
it does already for other image formats.
[km: updated package-version keyword and added NEWS entry]
Signed-off-by: Jay Kamat <jaygkamat@gmail.com>
* lisp/ob-sql.el (org-babel-execute:sql, org-babel-sql-dbstring-saphana):
Add basic support for SAP HANA to SQL blocks.
* testing/lisp/test-ob-sql.el: Basic tests for generated db connection
string.
This change adds basic support for SAP HANA to SQL blocks by
specifying saphana as :engine.
It also adds a new header arg `dbinstance' in order to specify the SAP
HANA instance to connect to.
- Removed the global (defvar date) and (defvar entry) so as not to
conflict with function arguments of that name. Instead I added such
`defvar`s in the body of each of the functions where it
seemed needed.
- I added some FIXMEs for some issues I found along the way.
- Added an `org-dlet` macro, just like I had done for `calendar-dlet`,
but I also use `defvar` "manually" at some places, when splitting an
existing `let` into a mix of `let`s and `dlet`s seemed too much trouble.
- Removed uses of `org-let and `org-let2` not only because I consider
them offensive to my sense of aesthetics but also because they're
basically incompatible with lexical scoping.
I replaced them with uses of `cl-progv` which are a bit more verbose.
Maybe we should define some `org-progv` macro on top of `cl-progv` to
make the code less verbose, but I didn't do that because I like the
fact that the current code makes uses of `eval` a bit more obvious
(since these behave differently with lexical scoping than with
lexical binding, it seemed worthwhile).
- Removed the use of `eval` in `org-store-agenda-views` which was only
placed there in order to use a macro before it's defined (it would
have been simpler/cleaner to just move that functions *after* the
macro, but with the new code the problem doesn't occur any more anyway).
- Replaced a few `(lambda...) with actual closures.
Detailed changes follow:
(date, entry): Don't declare as being globally dynbound.
(org-agenda-format-date-aligned): Remove unused var `weekyear`.
(org-agenda-mode): `run-mode-hooks` is always available nowadays.
(org-agenda-undo): Remove unused var `last-undo-buffer`.
(org-agenda): Rename arg to `keys` and then dyn-bind it as `org-keys`.
Remove unused vars `buf` and `key`.
(org-agenda): Use `pcase` and `cl-progv` instead of `org-let`.
(org-let, org-let2): Mark as obsolete.
(org-agenda-run-series): Use `cl-progv` instead of `org-let` and `org-let2`.
(org-agenda-run-series): New function.
(org--batch-agenda): New function extracted from `org-batch-agenda`.
(org-batch-agenda): Use it.
(org--batch-agenda-csv): New function extracted from `org-batch-agenda-csv`.
(org-batch-agenda-csv): Use it.
(org--batch-store-agenda-views): New function, extracted from
`org-batch-store-agenda-views`.
(org-store-agenda-views, org-batch-store-agenda-views): Use it.
(org--batch-store-agenda-views): Use `cl-progv` instead of
`org-eval-in-environment`.
(org-agenda-write): Use `cl-progv` instead of `org-let`.
Use `with-current-buffer`.
(org-agenda-filter-any): Use `cl-some` instead of `eval`.
(org-agenda-list): Remove unused var `e`.
(org-search-view): η-reduce.
(crm-separator): Declare var.
(org-agenda-skip-if): Remove unused var `beg`.
(org-agenda-list-stuck-projects): Use a closure rather than `(lambda..).
(diary-modify-entry-list-string-function, diary-file-name-prefix)
(diary-display-function): Declare vars.
(org-diary): Declare `date` and `entry` as dynbound.
(org-agenda-get-day-entries): Use `org-dlet`.
(org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-get-deadlines, org-agenda-get-scheduled, org-agenda-get-blocks):
Declare `date` as dynbound.
(org-agenda-get-sexps, org-class): Declare `date` and `entry` as dynbound.
(org-agenda-format-item): Declare the vars mentioned in
`org-compile-prefix-format` as dyn-bound.
Also binding `extra`, suggested by Kyle Meyer <kyle@kyleam.com>.
(org-compile-prefix-format): Remove unused var `e`.
Use `member` rather than or+equal.
(org-set-sorting-strategy): Minor simplification.
(org-entries-lessp): Use `org-dlet`.
(org-agenda-redo): Declare var `org-agenda-tag-filter-while-redo`.
(org-agenda-redo): Use `cl-progv` rather than `org-let`.
(org-agenda-filter): Remove unused var `rpl-fn`.
Use `org-pushnew-to-end` to replace `add-to-list` on lexical var.
(org-agenda-filter-by-tag): Remove unused var `n`.
(org-agenda-filter-apply): Use `org-dlet`.
(org-agenda-compute-starting-span): Remove unused var `dg`.
(org-agenda-forward-block): Remove unused var `pos`.
(org-archive-from-agenda): Declare var.
(org-agenda-refile): Remove unused var `pos`.
(org-agenda-headline-snapshot-before-repeat): Declare var.
(org-agenda-todo): Remove redundant use of `bound-and-true-p`.
(org-agenda-add-note): Remove unused var `hdmarker` and unused `arg`.
(org-agenda-change-all-lines): Remove unused var `pl`.
(org-agenda-priority): Remove unused var `marker`.
(org-agenda-set-effort): Remove unused var `newhead`.
(org-agenda-schedule): Remove unused var `type`.
(org-agenda-clock-cancel): Remove unused `arg`.
(org-agenda-execute-calendar-command): Use `org-dlet`.
(org-agenda-bulk-action): Use closures instead of `(lambda ...).
(org-agenda-show-the-flagging-note): Remove unused vars `heading` and
`newhead`.
(org-agenda-remove-flag): Avoid `setq`.
* testing/org-test.el (org--compile-when): New macro.
(org-test-jump): Use it so compilation doesn't fail or generate broken
code when `jump` is not available.
* testing/lisp/test-org-src.el:
* testing/lisp/test-org-attach.el:
* testing/lisp/test-org-agenda.el:
* testing/lisp/test-ob-java.el: Pass explicit filename to `require`
so as not to rely on ".../testing" being in `load-path` during compilation.
* lisp/org-num.el: Require` org`.
* lisp/org-macs.el (org-eval-in-environment): Declare obsolete.
(org-dlet, org-pushnew-to-end): New macros.
* doc/Makefile (org.texi, orgguide.texi, %_letter.tex): Simplify quoting.
* contrib/lisp/ob-sclang.el: Don't crash compilation when `sclang`
is not available.
* contrib/lisp/ob-clojure-literate.el: Don't crash compilation when `cider`
is not available.
* contrib/lisp/ob-arduino.el: Don't crash compilation when `arduino-mode`
is not available.
* .gitignore: Add files generated during `make packages/org`.
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
Overwrite existing output.
Make generation of texi from org overwrite output
18e1455c8ae851791a047dc56eef972cc24e5b6c
Glenn Morris
Sun Feb 28 15:13:07 2021 -0800
* lisp/ob-sqlite.el (org-babel-sqlite-expand-vars): Marked function as obsolete.
* lisp/ob-sql.el (org-babel-sql-expand-vars): Updated to support
expanding sqlite vars.
org-clocking-buffer and org-clock-is-active have the same definition.
org-clocking-buffer is defined in org-clock.el while
org-clock-is-active is defined in org.el. org-clock.el requires
org.el.
org-clocking-buffer is kept as an alias to preserve backward
compatibility with any user code.
* lisp/org-clock.el (org-clocking-buffer): Moved to org.el.
* lisp/org.el (org-clocking-buffer): Moved function.
(org-clock-is-active): Made into an alias.
It's annoying to accidentally quit Emacs with a running clock, then
resolve the clock the next time when Emacs is started.
* lisp/org-clock.el (org-clock-kill-emacs-query): New function.
(org-clock-ask-before-exiting): New user option.
[km: added package-version keyword, fixed function name typo]
* org.el (org-font-lock-add-priority-faces): Speed up regexp.
Only fontify priority cookies in headlines.
Note that the variable org-priority-regexp can't be modified since
it is used in the agenda and in org-get-priority.
TINYCHANGE
Suggested-by: Ihor Radchenko <yantar92@gmail.com>
* lisp/org.el: Don't require easymenu in Emacs 28 or later.
Minor fixes after preloading easymenu
b34d39170b67a7a285f7c8c2ea1b4128b531aad9
Stefan Kangas
Sat Feb 27 20:04:41 2021 +0100
* lisp/org.el: Don't require overlay; that's only needed in XEmacs.
Don't require overlay; that's only needed in XEmacs
2c639a35a6d71d190bea896bbeb14b279e8d8384
Stefan Kangas
Sat Feb 27 18:23:12 2021 +0100
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo-batch): New
function.
Distribute the real source for some doc/misc manuals (bug#45143)
fddd63f8b854f6bfa91403f69ba694ccb54197bc
Glenn Morris
Fri Feb 26 19:36:09 2021 -0800
While at it, I enabled lexical-binding in the affected files.
* lisp/org-agenda.el (org-let, org-let2): Move from org-macs and
use `declare`.
* lisp/org-macs.el (org-let, org-let2): Move these functions that are
inherently harmful to your karma to the only package that uses them.
(org-scroll): Use `pcase` to avoid `eval` and use more readable syntax
for those integers standing for events.
* lisp/org-element.el (org-element-map): Use `declare`.
Prefer `declare` over a `put` of `list-indent-function`.
8d5dfafab7dc40d4b74dc0b56d1b314fd8cac390
Stefan Monnier
Mon Feb 22 11:54:17 2021 -0500
* lisp/org-agenda.el (org-add-to-diary-list): Remove.
(org-diary-default-entry): Use diary-add-to-list directly.
org-agenda has compatibility kludges for the rename of
add-to-diary-list and the number of required arguments; both are no
longer needed. The fourth argument has been optional since 22.1, and
add-to-diary-list was marked as obsolete in favor of diary-add-to-list
in Emacs 23.1 and removed in Emacs 25.1.
* lisp/ob-latex.el (org-babel-latex-begin-env):
(org-babel-latex-pdf-svg-process): Shorten docstring to under 80
characters.
* lisp/org-plot.el (org-plot/preset-plot-types): Fill long lines and
add two spaces after periods.
With Emacs 28.0.50 the byte-compiler now warns about docstrings that
are too wide. The recent ports from the Emacs repo covered all of the
cases that have already made their way to the Emacs tree.
* lisp/org-agenda.el (org-agenda-goto-date): Restore DATE argument
(removed in 7.9.3e), replacing unused SPAN argument.
* testing/lisp/test-org-agenda.el (test-org-agenda/goto-date): Add
test.
Among other changes, 93fcfe4d3 (2012-08-30) switched
org-agenda-goto-date's DATE argument to SPAN, moving the org-read-date
call out of the interactive form. The new argument is unused, and
it's not clear that this part of the change was needed for the fix.
It prevents lisp callers from specifying a date, so move the
org-read-date call back to the interactive form.
Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
Ref: https://orgmode.org/list/87pn10t83u.fsf@m4x.org
* lisp/org.el (org-adapt-indentation): Adjust :safe value for
headline-data, avoid unnecessary quote in :type value, and follow the
convention for quoting symbols in docstrings.
* org-clock.el (org-clock-in): Under certain configurations of org,
Emacs doom, evil-org-mode and my custom settings, org-clock-in aborts
with an an error because indent-line-to is called with -2.
TINYCHANGE
* lisp/org-agenda.el (org-agenda-filter): Downcase tags in the search
string provided by user. This is needed because all the tags stored
in 'tags text property are downcased.
Example when old code did not work is a tag like COMMON. The user
would not expect a need to input +|-common in the agenda filter
instead of +|-COMMON. The latter would only result in
"COMMON filter ignored because tag/category is not represented".
* lisp/org-agenda.el (org-agenda-bulk-custom-functions): Add
documentation about argument collection for custom bulk functions.
(org-agenda-bulk-action): Support function to collect arguments for
custom bulk functions.
* etc/ORG-NEWS (Option ~org-agenda-bulk-custom-functions~ now supports
collecting bulk arguments): Add entry to NEWS.
Porting from Emacs's master to Org's maint branch has been on hold
leading up to the Emacs 27.2 release to avoid any required fixup syncs
carrying those commits into the emacs-27 branch. This merge brings
those changes into master. The km/from-emacs-master branch should be
merged to maint when Emacs 27.2 has been released (assuming Org 9.5
hasn't been released, in which case maint will be tracking 9.5.x and
already include these changes).
* lisp/ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Use `declare`.
* lisp/ob-core.el (org-babel-map-src-blocks): Use `declare`.
(org-babel-result-cond): Simplify edebug spec.
* lisp/org-clock.el (org-with-clock-position, org-with-clock):
* lisp/org-agenda.el (org-agenda-with-point-at-orig-entry):
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): Use `declare`.
Use `declare` instead of `def-edebug-spec` in most places
f8dbefbaa59bb17dd4a2dfa4d9ff560c46785792
Stefan Monnier
Fri Feb 12 16:08:01 2021 -0500
* lisp/org-table.el (org-table-edit-field):
* lisp/org.el (org-restart-font-lock): Assume font-lock-mode variable
is not void; it is preloaded.
Assume font-lock-mode variable is not void
bbe88cd82e4bbfd76df06223614ab74d1022c119
Stefan Kangas
Fri Feb 5 01:15:02 2021 +0100
* lisp/org-agenda.el (org-agenda-filter-by-category): Shorten doc
strings to not exceed 80-column limits. (Bug#44858)
Shorten some over-wide docstrings in functions and macros
34a73666d9559d948815a53b63dc36cc878d5aff
Stefan Kangas
Sat Dec 19 18:21:06 2020 +0100
* lisp/org-indent.el
(org-indent-mode-turns-off-org-adapt-indentation)
(org-indent-mode-turns-on-hiding-stars):
* lisp/org-protocol.el (org-protocol-project-alist): Shorten doc
strings to not exceed 80-column limits. (Bug#44858)
Shorten over-wide docstrings in defcustoms
5ab5c3898778406103e7183bf41c7d018077092b
Stefan Kangas
Sat Dec 19 18:21:06 2020 +0100
* lisp/org-ctags.el (org-ctags-open-link-functions): Fix doc strings
to not exceed 80-column limits. (Bug#44858)
Fix over-wide doc strings
64d97212f42bc0305560a0ae2cc2f16a3a851117
Eli Zaretskii
Sat Dec 19 13:18:11 2020 +0200
* lisp/ob-core.el (org-babel--string-to-number): Put hyphen last in
alternative.
* lisp/org-agenda.el (org-agenda-filter): Escape '+' correctly.
Follow good regexp practice
46394dff7f01e7fe4af06a6c344e151af5c3eef4
Mattias Engdegård
Fri Dec 18 14:35:09 2020 +0100
* lisp/ob-java.el (org-babel-execute:java): Restore inspection of
:dir's value to decide whether to run from temporary directory.
My compatibility fix in the previous commit incorrectly changed the
documented and intended behavior for (:dir . nil).
Reported-by: Ian Martins <ianxm@jhu.edu>
* ob-sql.el (org-babel-execute:sql): Use `sql-postgres-program' as
postgresql executable (instead of psql) when defined. psql will be
the default.
[km: tweaked commit message, added bound-and-true-p guard]
TINYCHANGE
* lisp/org-capture.el (org-capture-set-target-location): Bind
org-end-time-was-given around the org-read-date call to get a return
value that uses the start time rather than doing custom adjustment of
the return value.
If org-capture-set-target-location detects that the answer to
org-read-date has a time range, it strips the end time from the answer
and calls org-read-date-analyze again. (org-read-date already calls
it underneath.) The regexp it uses, however, can easily match a date,
leading to a bogus result.
org-read-date-analyze is already capable of processing the time range
in a way that matches org-capture-set-target-location's intent: when
org-end-time-was-given is bound, org-read-date-analyze splits off the
end value of the range and stores it in org-end-time-was-given. Drop
the custom logic and let org-read-date-analyze handle the range.
Reported-by: Richard Lawrence <richard.lawrence@berkeley.edu>
Ref: https://orgmode.org/list/87h7obh4ct.fsf@aquinas
* ox-latex.el (org-latex-listings-langs): Change the binding for
`ocaml' to "[Objective]Caml"
The "[Objective]Caml" dialect syntax highlighting is different from the
"Caml" one (reflecting the added features of OCaml compared to
Caml-light).
TINYCHANGE
* ox-latex.el (org-latex-export-to-pdf): The documentation for
`org-latex-pdf-process' states that "%bib" will be expanded into the
current binding of `org-latex-bibtex-compiler'. However, the
`org-latex-export-to-pdf', where the expansion takes place, expects
"%bibtex" instead. This fix will accept "%bib" as well as "%bibtex"
as markers for `org-latex-bib-compiler'.
This fixes a regression from f6187deca (ox-latex: Small refactor,
2015-09-13).
TINYCHANGE
* lisp/org-macs.el (org-matcher-time): Handle hour ("h") time stamp
modifier.
* doc/org-manual.org (The date/time prompt): Document hour modifier.
This adds support for date expressions such as +12h to
org-matcher-time. The regexp this function uses to parse such relative
expressions already includes the "h" character but doesn't actually
handle that case.
AFAICT org-mode commit ec921a2a68 ("Support hourly repeat cookies")
neglected to add support here.
TINYCHANGE
* lisp/ox-html.el (org-html-meta-tags): Introduce this as a new option
which can be modified to set the meta tags added in HTML exports.
(org-html--build-meta-info): Make use of `org-html-meta-tags' instead of
hardcoded meta tags. This is leveraging the earlier restructuring of
`org-html--build-meta-info' into a much DRYer form, such that this
modification has a negligible impact on complexity and readability.
* lisp/ox-html.el (org-html--build-meta-info): Multi-line repeated
structure extracted to new function `org-html--build-meta-entry'.
The keyword value formatting is changed from `org-export-data' to
`org-html-encode-plain-text' to avoid potentially nesting HTML tags in
meta tags and the <title> element, which would violate W3C.
lisp/ob-java.el: Allow source block headers to override the java
compiler or runtime commands.
Currently the java compiler and runtime commands are customizable, but
cannot be overridden locally in source block hearders. ob-python
allows overriding the runtime command and I've found it to be useful.
This does the same for ob-java.
* 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.
* org-footnote.el (org-footnote-create-definition): Replace
`forward-line' with `org-end-of-meta-data' to skip over any
properties and/or drawers that may be present on the
`org-footnote-section' heading (default "Footnotes").
TINYCHANGE
* lisp/org.el (org-fast-tag-selection): Merge buffer local tags with
global alist of tags. And it obeys the option
org-complete-tags-always-offer-all-agenda-tags.
* doc/org-manual.org: Update the TAB key doc in tags selection UI.
* etc/ORG-NEWS: Mention the change in org-set-tags-command.
* lisp/org-duration.el (org-duration-units): Guard against recursive
load error when org-duration-units is set via the Customize interface
before org-duration is loaded.
This follows the same approach used by erc-nickserv-identify-mode in
the Emacs repository.
Reported-by: Mario Bourgoin <m.bourgoin@gmail.com>
Ref: https://orgmode.org/list/CAM0Tqh+u+L+UgZizJrH+a+W7Lo1stPJgTsRABxD3HobOnOCrNA@mail.gmail.com
* lisp/org-plot.el (org--plot/values-stats): Replace `log10' with
`log'.
(org--plot/nice-frequency-pick): Replace obsolete `case' with `cl-case`.
(org--plot/radar): Replace `s-join' with `mapconcat', removing the
implicit dependency on s.el.
(org-plot/gnuplot-script): Remove unused let bindings.
(org-plot/gnuplot-script): Replace free variable reference with
expression only using given variables.
de6d90224 (org-attach: Consider inlinetasks when calculating attach
dir, 2020-12-17) introduced a call to org-inlinetask-goto-beginning
and org-inlinetask-in-task-p, each behind a featurep guard.
* lisp/org-agenda.el: Remove `generated-autoload-file' local
variable.
* lisp/org-capture.el: Ditto.
This is a continuation of a4e6a6fa7 which fixes fae16ed8f.
Reported-by: Andrii Kolomoiets <andreyk.mad@gmail.com>
* lisp/org-lint.el (org-lint--display-reports): Remove
`tabulated-list-print' call. This is already taken care of by
`org-lint--refresh-reports' above.
* lisp/org-attach.el (org-attach): When inside inlinetask, return
attachment dir of that task. When outside inlinetask, return
attachment dir of the main task ignoring any inlinetasks above point.
The call to `org-back-to-heading-or-point-min` does not move point to
the actual heading when there is inlinetask above the point. The
result is incorrect return value or even creation of property drawer
below *...** END line of the last inline task before point.
* lisp/ox-html.el (org-html-style-default): Add the margin-top
property to pre.src:hover:before so that the programming language is
fully visible.
TINYCHANGE
* lisp/org-plot.el (org--plot/values-stats): A set of numbers with the
same value (i.e. 0 range) should not produce an arithmetic overflow
error.
This error was caused by taking the log of 0 (when the range is
0). This is mitigated by explicit checking against this case.
* lisp/org-plot.el (org-plot/preset-plot-types): Adapt structure to
cover all type-specific logic within org-plot.
(org-plot/gnuplot-script, org-plot/gnuplot): Replace type-specific logic
with references to properties of the type from
`org-plot/preset-plot-types'.
* lisp/org-plot.el (org-plot/gnuplot): If statement in transposition
treated condition as its negative, to fix this the condition was
inverted.
It was also noticed that the code could not operate as expected as the
user-supplied #+plot options were not fetched. Resolved by re-inserting
relevant code from an older version of org-plot.
* lisp/org-plot.el (org--plot/radar): Implement a new plot type "radar".
(org--plot/radar-template): A huge template sting for `org-plot/radar'.
(org--plot/radar-ticks, org--plot/radar-setup-template): Smaller
template strings for use in `org-plot/radar'.
(org-plot/preset-plot-types): Add the new "radar" type to the list of
default types.
The radar type has a long and complex implementation, but that's exactly
what makes it perfect for something like this. A complex plot can be
produced with a simple keyword in the #+PLOT options. There are still a
few kinks that would benefit from being ironed out, but the current
state is fully-functional.
* lisp/org-plot.el (org-plot/gnuplot-script): Call the term and preamble
functions (mentioned below) with the plot type as the argument.
(org-plot/gnuplot-script-preamble, org-plot/gnuplot-term-extra): update
docstring.
* lisp/org-plot.el (org-plot/gnuplot-term-extra): New option to let
the user to tweak the gnuplot term settings. This allows for setting
characteristics such as default size, or background colour.
(org-plot/gnuplot-script): Use the new option for customisation of
org-plot's term.
* lisp/org-plot.el (org-plot/add-options-to-plist): Add the options :ymin
:ymax :xmin :xmax, as well as :min and :max as aliases to the y{min,max}
options. The :ticks option is also added, for specifying how many ticks
should be used.
(org--plot/values-stats, org--plot/sensible-tick-num,
org--plot/nice-frequency-pick, org--plot/merge-alists,
org--plot/item-frequencies, org--plot/prime-factors): New utility
functions added to allow for somewhat sensible determination of a :ticks
value when none is provided. This turns out to be harder than expected,
and so a number of functions are used to attempt to do so. The essence
of the method used, is to round values and find their prime
decompositions. From this we try to select the most common components
to give a reasonable step size. We also add a 'ticks' parameter for
manually setting the number of ticks, and (y)min/max parameters
similarly.
* lisp/org-plot.el (org-plot/preset-plot-types): New option to declare
plot types and provide a lambda which is called with a fixed signature
to generate associated gnuplot code. The previously hardcoded types
are implemented as the default value.
(org-plot/gnuplot-script): Abstract the generation of gnuplot commands
from the three hardcoded types: 2d, 3d, and grid.
* lisp/org-plot.el (org-plot/gnuplot-script-preamble): New option
which can be either a string or a function. The value of this (when
executed, in the case of the function) is inserted near the top of the
generated gnuplot script.
(org-plot/gnuplot-script): Use the new variable
`org-plot/gnuplot-script-preamble' in the manner described.
This allows for the user to set the font/colour-scheme, default
precision, and much more.
* lisp/org-plot.el (org-plot/add-options-to-plist,
org-plot/add-options-to-plist): Add a new option :transpose, and a
shorter alias :trans. Transposition is performed if the argument is yes,
y, or t. This treats the table as a matrix and performs matrix
transposition on it. If an hline is present, it is assumed that it is a
marks a separation from a first header row. The first row is then
treated as the new header by inserting a hline in the transposed data.
This is quite useful for some plots, where across multiple categories,
there are a large number of data points. Without this, the data points
would be columns and the table can spread irritatingly wide.
* lisp/org-plot.el (org-plot/gnuplot): Make indentation consistent, by
replacing a few spaces with tabs.
Only 6 of 347 lines used spaces instead of tabs.
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): When 'command'
is a function from 'inf-ruby-implementations', use 'funcall' to get
a command string for the first arg of 'run-ruby-or-pop-to-buffer'.
This is like what 'run-ruby' does.
Reported-by: Aaron Madlon-Kay <aaron@madlon-kay.com>
Ref: https://orgmode.org/list/CAHvKJZsAUtYOKV1bH_r9BXqE_d6k11qg4dfxvqCUVUxjmGohGw@mail.gmail.com
These show up in the Emacs repo (before and after the latest sync in
f22856a5c5), but for an unknown reason do not show up with `make
compile' or `make single' in the Org repo.
All of these functions are autoloaded.
* lisp/org.el (org-in-archived-heading-p): When called on a heading
with a tag containing org-archive-tag string as a substring, that
heading was incorrectly recognised as archived. Changed matching
against the whole :tag1:tag2:...: string to matching against tag list
as returned by `org-get-tags'.
* testing/lisp/test-org.el (test-org/in-archived-heading-p): Add test
when one of the heading tags contains org-archive-tag as a substring.
* lisp/org.el (org-optimize-window-after-visibility-change): Reset
org-scroll-position-to-restore if it is not a repeated call.
The org-scroll-position-to-restore variable is used to save the
position, but the position may be from a cycling sequence other than
the current one. Reset it at the start of a sequence.
* lisp/org.el (org-optimize-window-after-visibility-change): Guard
against calling set-window-start with a nil POS argument.
org-optimize-window-after-visibility-change calls set-window-start
with org-scroll-position-to-restore when it is a repeat call
(i.e. last-command and this-command match). However,
org-scroll-position-to-restore may not have yet been set yet (e.g. if
org-startup-folded is at its default value of showeverything).
Calling set-window-start appears to generally be a noop, but, for a
reason that I don't understand, it triggers a hang when %p is in
frame-title-format.
Reported-by: Massimo Lauria <massimo.lauria@uniroma1.it>
Ref: https://orgmode.org/list/CAJCFsEEHJXP4nKZpWdzheMM5O0Dq-tT+v0u0FsT+3Q0mi4v10A@mail.gmail.com
* lisp/org.el (org-fixup-indentation): Don't call indent-line-to with
a negative value.
* testing/lisp/test-org.el (test-org/promote):
(test-org/demote): Add tests.
The handling added in 11ef7454a (org.el (org-fixup-indentation): Fix
logbook drawers indentation, 2020-09-07) calls indent-line-to with a
value equal to the sum of current indentation and the DIFF argument,
but this can lead to a type error because DIFF may be negative.
Note that, aside from the headline-data test cases, the added tests on
top of the parent of e3b79ad2b (Allow a new value for
`org-adapt-indentation', 2020-02-09), which added the initial logbook
special case to org-fixup-indentation.
Reported-by: Duianto <otnaiud@gmail.com>
Ref: https://orgmode.org/list/CAE-tX7i5ew3ED3YX6jjx57qNuRtV0AumWKuE0W83YUUReKE5-g@mail.gmail.com
Reported-by: stardiviner <numbchild@gmail.com>
Ref: https://orgmode.org/list/CAL1eYuKObYzY2MHSQ+W08mW3TZ+83H45teOq_rHq9qz7-FEgKw@mail.gmail.com
* lisp/ox-latex.el (org-latex-footnote-reference): Use the footmark +
footnotetext combination for footnotes in verse environments.
(org-latex-verse-block): Use `org-latex--delayed-footnotes-definitions'.
Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
<http://lists.gnu.org/r/emacs-orgmode/2020-12/msg00006.html>
* lisp/org.el: Don't require 'font-lock'; it is preloaded since
version 22.1.
Remove redundant requires of 'font-lock'
0a4aa2894297c0fd9e735328bbb60b427e0ba5d4
Stefan Kangas
Thu Dec 3 08:50:14 2020 +0100
* lisp/ol.el (org-link-search): Account for orphan #+name keyword.
If #+name is followed by a blank line (making it an invalid affiliated
keyword), :name is nil.
Reported-by: Dima Kogan <dima@secretsauce.net>
Ref: https://orgmode.org/list/875z5xf7f7.fsf@secretsauce.net
* lisp/org-goto.el: Require org.el and org-refile.el.
org-goto.el depends on org.el and org-refile.el being loaded, and the
autoloaded org-goto command may be called before org.el and
org-refile.el are loaded (and an org-refile.el load won't be triggered
just by visiting an Org file).
Reported-by: Omar Antolín Camarena <omar@matem.unam.mx>
Ref: https://orgmode.org/list/87h7pil2v5.fsf@matem.unam.mx
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): Instead of
run-ruby that always insists on using the existing buffer, use
run-ruby-or-pop-to-buffer that allows using the buffer with the
same name as :session header arg. Use the existing buffer
returned by inf-ruby-buffer only when :session header arg is nil.
https://github.com/nonsequitur/inf-ruby/issues/121
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.4 to
Emacs 27.2.
9.4.x, rather than 9.3.8, may be synced for the upcoming Emacs 27.2
release (bug#43268, <87lfeo3vzg.fsf@bzg.fr>).
* lisp/org-capture.el (org-capture-templates): Enhance description and
add 'month' value for :tree-type in description.
* doc/org-manual.org: Fix typo for displaying 'month' in :tree-type
property.
TINYCHANGE
* lisp/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/ob-screen.el (org-babel-default-header-args:screen): Use
null-device. (Bug#3736)
Use null-device where appropriate
67a8bdb90c9b5865b7f17290c7135b1a5458c36d
Michael Albinus
Wed Nov 25 22:13:33 2020 +0100
[km] Resolved conflict in ob-screen. "/dev/null" was relocated to
org-babel-default-header-args in 0ab117bc5 (ob-screen: Accept
:screenrc header argument, 2020-07-14).
* org-table.el (org-table-eval-formula): Add the `u` mode flag to
enable Calc's units simplification mode.
* test-org-table.el (test-org-table/mode-string-u): Add Unit test for
the new mode flag.
* org-manual.org: Document new mode flag.
* org-table.el (org-tbl-calc-modes): Remove variable declaration as
the varialble is used only within `org-table-eval-formula'.
* org-table.el (org-table-eval-formula): Rename `org-tbl-calc-modes`
local variable without the `org-tbl-` prefix and use the gained screen
real estate to avoid indirection through covenience macro. This
requires moving the mode lookup table from `org-table--set-calc-mode`
to here.
* org-table.el (org-table--set-calc-mode): Drop convenience macro.
Note that the macro was not working as intended when the caller tried
to add a new entry in the plist as in this case the macro would create
a new plist with the added entry but return the old one.
* lisp/ob-java.el(org-babel-execute:java): Previously the source file
was always written to the local machine so execution on the remote
machine was not possible. Now we write the source file to the remote
temp directory when the current directory is remote.
* 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