Commit graph

16615 commits

Author SHA1 Message Date
Jay Kamat a9f38b1c22 ox-html: Add webp as an inline image format
* 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>
2021-03-19 01:11:00 -04:00
Robin Campbell Joy b241c126b4 ob-sql.el: Add support for SAP HANA
* 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.
2021-03-16 23:53:09 -04:00
Sébastien Miquel 7c4d057cd4 org-compat.el (org-mode-flyspell-verify): Do not check code in headline
* lisp/org-compat.el (org-mode-flyspell-verify): Do not spell check
code, verbatim and LaTeX fragments in headline title.

TINYCHANGE
2021-03-14 22:50:53 -04:00
Kyle Meyer d477f61ee1 Merge branch 'km/from-emacs-master' 2021-03-14 22:07:30 -04:00
Mattias Engdegård f771d205cc Backport commit a0854f939 from Emacs
; Fix typos in doc strings
a0854f939ce3a1de2c8cbc5e38b106a8df4480f6
Mattias Engdegård
Fri Mar 12 12:12:14 2021 +0100
2021-03-14 17:57:07 -04:00
Stefan Monnier a85b4cc5c6 Backport commit 7d0dc3183 from Emacs
* lisp/ob-lilypond.el (org-babel-lilypond-compile-lilyfile):
Remove always-nil variable `arg-2`.

* lisp/ol-gnus.el (org-gnus-store-link):
Remove always-nil variables `newsgroup` and `xarchive`.

* lisp/ol.el (org-store-link):
Remove always-nil variable `description`.

* lisp/org-clock.el (org-clock-special-range):
Remove always-nil variables `m1` and `m`.

* lisp/org-crypt.el (org--matcher-tags-todo-only): Declare var.

* lisp/org-protocol.el (org-protocol-open-source):
Remove always-nil variable `result`.

* lisp/ox-odt.el (org-odt-format-label):
Remove always-nil variable `short-caption`.
(org-odt-link--inline-formula):
Remove always-nil variables `width` and `height`.

* lisp/ox.el (org-export--missing-definitions):
Remove always-nil variable `seen`.

* lisp/: Delete some always-nil variables
7d0dc31833d471a6f86e947d3165d3fd1452a184
Stefan Monnier
Thu Mar 11 13:07:37 2021 -0500
2021-03-14 17:54:17 -04:00
Stefan Monnier 129c33dddf * lisp/org-agenda.el: Use lexical-binding
- 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`.
2021-03-09 22:56:33 -05:00
Kyle Meyer 5263eff5a3 org.el: Specify minimum Emacs version in Package-Requires header
* lisp/org.el: Specify minimum Emacs version in Package-Requires
header.

Suggested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Link: https://orgmode.org/list/jwvv9a01l1o.fsf-monnier+emacs@gnu.org
2021-03-09 22:16:15 -05:00
Kyle Meyer 04e5d08faf Merge branch 'km/from-emacs-master' 2021-03-09 22:13:07 -05:00
Glenn Morris 2da3b0ebc3 Backport commit 18e1455c8 from Emacs
* 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
2021-03-09 22:12:02 -05:00
Nicholas Savage 37749c1657 Reduce code duplication in ob-sqlite.el and ob-sql.el
* 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.
2021-03-09 00:43:43 -05:00
Allen Li 16b5ee0efb org-clock: Replace org-clocking-buffer with org-clock-is-active
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.
2021-03-03 22:50:04 -05:00
Allen Li 303e7c28e4 org-clock: Query when exiting with running clock
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]
2021-03-03 22:50:03 -05:00
Sébastien Miquel a03b4656cf org.el (org-font-lock-add-priority-faces): Speed up regexp
* 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>
2021-03-02 00:01:45 -05:00
Kyle Meyer 8b9d6f67a0 Merge branch 'km/from-emacs-master' 2021-02-28 17:24:54 -05:00
Stefan Kangas 7922d161c0 Backport commit b34d39170 from Emacs
* 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
2021-02-28 17:24:25 -05:00
Stefan Kangas f9a414eb83 Backport commit 2c639a35a from Emacs
* 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
2021-02-28 17:24:25 -05:00
Glenn Morris 6382dbc950 Backport commit fddd63f8b from Emacs
* 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
2021-02-28 17:24:25 -05:00
Stefan Monnier 63da3ccfb4 Backport commit 8d5dfafab from Emacs
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
2021-02-28 17:24:24 -05:00
Kyle Meyer 0b117f72a8 agenda: Drop org-add-to-diary-list
* 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.
2021-02-25 00:20:26 -05:00
Kyle Meyer 15c7385458 org-clone-subtree-with-time-shift: Support hour time shift
* lisp/org.el (org-clone-subtree-with-time-shift): Support hour time
shift.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
tests.

Suggested-by: Felipe Barros <felipebarros@protonmail.com>
Link: https://orgmode.org/list/urqRSSSRsE8In5xtAPBR8AZalNGUCBkwwVV8ujNSN8_AOyh0reiE8XMrY6eviTBYUsV5fCF5GyJAtw7FB8xo-XBPPpYHOnP0zQuce4odhI8=@protonmail.com
2021-02-25 00:05:51 -05:00
Kyle Meyer 9e98e9a731 Shorten remaining over-wide docstrings
* 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.
2021-02-23 23:35:57 -05:00
Kyle Meyer d21d200bc0 Merge branch 'maint' 2021-02-21 01:19:08 -05:00
Kyle Meyer 3a522ad539 agenda: Restore org-agenda-goto-date's date argument
* 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
2021-02-21 01:18:07 -05:00
Nicolas Goaziou a1cdbbfc85 ox-calendar: Require Org Agenda
* lisp/ox-icalendar.el (org-agenda): Require Org Agenda. Export fails
if Agenda is not loaded.
2021-02-20 10:41:02 +01:00
Nicolas Goaziou 57bd7b57cc ox-icalendar: Remove unnecessary inner template
* lisp/ox-icalendar.el (icalendar): Remove inner template, which is
the default value anyway.
2021-02-20 10:39:32 +01:00
Kyle Meyer f4692572ba Merge branch 'maint' 2021-02-17 00:14:39 -05:00
Kyle Meyer 4ab2a4be51 org-adapt-indentation: Tweak headline-data addition
* 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.
2021-02-17 00:14:26 -05:00
Jean-Marie Gaillourdet ee4ffa5672 org-clock: fix runtime error in org-clock-in
* 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
2021-02-16 23:33:19 -05:00
Kyle Meyer f5cfd32880 Merge branch 'maint' 2021-02-15 00:55:57 -05:00
Ihor Radchenko 75ccb9719f Allow tags containing capital letters in org-agenda-filter
* 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".
2021-02-15 00:50:05 -05:00
Kevin J. Foley 885ee086dd org-agenda.el: Support argument collection for custom bulk functions
* 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.
2021-02-14 21:53:14 -05:00
Kyle Meyer e0fb2339f4 Merge branch 'km/from-emacs-master'
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).
2021-02-14 18:06:23 -05:00
Stefan Monnier 7dd1cfb6ca Backport commit f8dbefbaa from Emacs
* 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
2021-02-14 17:38:07 -05:00
Stefan Kangas b7b52aa888 Backport commit ce35760b1 from Emacs
; Minor license statement fixes
ce35760b19315b634e62e2c64988018189dcdbdc
Stefan Kangas
Mon Feb 8 09:10:57 2021 +0100
2021-02-14 17:38:07 -05:00
Stefan Kangas 4aa4ae8cf0 Backport commit bbe88cd82 from Emacs
* 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
2021-02-14 17:38:07 -05:00
Stefan Kangas d8e8a97a14 Backport commit a8caa6690 from Emacs
* doc/org-manual.org (Link Abbreviations):
* lisp/org/ol.el (org-link-shell-confirm-function)
(org-link-elisp-confirm-function):
* lisp/org/org.el (org-highlight-links): Avoid recommending Google.

Avoid recommending Google
a8caa66906b157c9c2b4c4dc1c447b6a9e747c5e
Stefan Kangas
Thu Jan 28 19:36:12 2021 +0100
2021-02-14 17:38:07 -05:00
Stefan Kangas a633d9aea6 Backport commit dd662fc97 from Emacs
* lisp/ob-sql.el (org-babel-sql-dbstring-vertica):
* lisp/ol-bbdb.el (org-bbdb-date-list): Fix doc strings to not exceed
80-column limits.  (Bug#44858)

Fix some over-wide docstrings
dd662fc972a75df71cdaa25a2d763d1592df1eb8
Stefan Kangas
Wed Dec 30 12:44:19 2020 +0100
2021-02-14 17:38:07 -05:00
Stefan Kangas 263d3852f6 Backport commit 34a73666d from Emacs
* 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
2021-02-14 17:38:07 -05:00
Stefan Kangas d904f9e5da Backport commit f88a7897a from Emacs
* lisp/ob-R.el (org-babel-R-write-object-command):
* lisp/org-attach.el (org-attach-after-change-hook):
* lisp/org.el (org-stamp-time-of-day-regexp): Shorten doc strings to
not exceed 80-column limits.  (Bug#44858)

Shorten over-wide docstrings in variables
f88a7897a80ee9129bdc444cafff32d026c4b6d8
Stefan Kangas
Sat Dec 19 18:21:06 2020 +0100
2021-02-14 17:38:07 -05:00
Stefan Kangas ce22aa15fd Backport commit 5ab5c3898 from Emacs
* 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
2021-02-14 17:38:07 -05:00
Eli Zaretskii ec52bfef54 Backport commit 64d97212f from Emacs
* 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
2021-02-14 17:38:07 -05:00
Mattias Engdegård 4c934424d6 Backport commit 46394dff7 from Emacs
* 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
2021-02-14 17:38:04 -05:00
Kyle Meyer ff1e8f3eba ob-java: Fix previous commit
* 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>
2021-02-14 15:42:18 -05:00
Kyle Meyer 49364f904b Avoid alist-get for compatibility with Emacs 24
* lisp/ob-java.el (org-babel-execute:java):
* lisp/org-id.el (org-id-store-link): Don't use alist-get, which isn't
available until Emacs 25.
2021-02-07 20:05:51 -05:00
Jeremie Juste 0c6ab87d11 ob-R.el: For :results value return empty string instead of nil 2021-02-06 21:36:55 +01:00
Gustav Wikström be2966abb5 org-id: Add title to description when storing id links
* lisp/org-id.el (org-id-store-link): Store title as link description
if it is available.
2021-02-06 20:46:05 +01:00
Kyle Meyer 369eb27397 Merge branch 'maint' 2021-02-04 00:56:43 -05:00
Alan Light 862048d4cb ob-sql.el: Respect the value of sql-postgres-program
* 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
2021-02-03 23:08:21 -05:00
Kyle Meyer e879596159 footnote: Silence byte-compiler under 'make single' 2021-02-03 23:07:33 -05:00
Kyle Meyer 26773a404e Merge branch 'maint' 2021-02-03 01:27:15 -05:00
Stefan Kangas 2ed1c20ff7 Remove Emacs 21 compat code for bookmark-after-jump-hook
* lisp/org-compat.el (bookmark-after-jump-hook): Remove Emacs 21
compat code.
2021-02-03 01:26:51 -05:00
Kyle Meyer 0414597272 Merge branch 'maint' 2021-02-02 00:26:43 -05:00
Kyle Meyer 3e64d3475d capture: Fix handling of time range for :time-prompt
* 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
2021-02-01 23:18:03 -05:00
John Herrlin f85bef28d9 ob-java: Allow import to end with asterisk
* lisp/ob-java.el (org-babel-java--imports-re,
org-babel-java--import-maybe): Allow import to end with asterisk.

TINYCHANGE
2021-01-30 05:32:29 -05:00
Kyle Meyer bc511b1cb8 Merge branch 'maint' 2021-01-24 23:12:33 -05:00
Basile Pesin 0abd4a44cb ox-latex.el: Use [Objective]Caml dialect
* 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
2021-01-24 23:05:53 -05:00
Stefan Kangas a50a42ceae Use lexical-binding cookie in some trivial files
* mk/org-fixup.el (org-make-org-version): Add lexical-binding cookie
to autogenerated files.
* lisp/org-install.el: Use lexical-binding.
2021-01-24 22:36:30 -05:00
Kyle Meyer 72e368a2e9 Merge branch 'maint' 2021-01-24 22:17:01 -05:00
Tara Lorenz 13e98e2a13 ox-latex.el: fix interpretation of org-latex-pdf-process
* 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
2021-01-24 22:16:45 -05:00
Daniel Gröber aeb9f036ff org-macs: Allow specifying relative time in hours
* 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
2021-01-24 22:16:45 -05:00
Kyle Meyer a12449ac19 org-compat: Fix symbol quoting in a comment 2021-01-24 22:15:10 -05:00
Turbo Cafe 3916a57406 ox-md.el: Preserve radio target hyperlink
* lisp/ox-md.el (org-md-link): Format markdown hyperlink from radio
target.

TINYCHANGE
2021-01-22 00:05:47 -05:00
TEC a8df7670c8 lisp/ox-html.el: make html meta tags customizable
* 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.
2021-01-20 22:27:02 -05:00
TEC f4b9f98088 lisp/ox-html.el: make html meta tag builder nicer
* 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.
2021-01-20 22:02:46 -05:00
Ian Martins 7fa8173282 ob-java: Allow header to override commands
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.
2021-01-16 15:52:21 -05:00
John Herrlin d700dff7ac ob-java: Include static imports in regex
* lisp/ob-java.el (org-babel-java--imports-re): Include static imports
in Java import regex.

TINYCHANGE
2021-01-16 15:43:34 -05:00
tbanelwebmin@free.fr 9e8215f4a5 ob-C.el: Fix missing C, C++ declaration
* 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.
2021-01-14 21:20:00 +01:00
Kyle Meyer edda21e931 Merge branch 'maint' 2021-01-14 00:16:57 -05:00
TRS-80 1806abdc39 org-footnote: Fix inserting new footnote mangling drawers
* 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
2021-01-14 00:16:40 -05:00
stardiviner 86ad8d2791 org.el: Complete tags from both global and buffer local
* 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.
2021-01-14 00:15:55 -05:00
Kyle Meyer 5b5c420da5 Merge branch 'maint' 2021-01-07 00:14:37 -05:00
Kyle Meyer 33de2bd8ef org-compat: Take in obsolete org-copy
* lisp/org-compat.el (org-copy): Move from org-refile.el.
* lisp/org-refile.el (org-copy): Move to org-compat.el.

Suggested-by: Marco Wahl <marcowahlsoft@gmail.com>
Ref: https://orgmode.org/list/87o8i2cpb2.fsf@gmail.com
2021-01-07 00:14:27 -05:00
Stefan Monnier 248dfcd711 Backport commit 5ada3eece from Emacs
* lisp/org-refile.el (org-copy): Fix missing obsoletion version.

5ada3eecec79703a84e2f2c38cae16ef4b2600cc
Stefan Monnier
Thu Dec 17 18:21:47 2020 -0500
2021-01-07 00:13:50 -05:00
Nicolas Goaziou c07808af14 Merge branch 'maint' 2021-01-05 18:07:29 +01:00
Nicolas Goaziou 332da69b3c element: Fix table.el parsing... again!
* lisp/org-element.el (org-element--current-element): Properly parse
table.el tables ending at limit.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-01/msg00067.html>
2021-01-05 18:06:31 +01:00
Kyle Meyer 00b4de3294 ol: Avoid initial input when completing function for storing link
* lisp/ol.el (org-store-link): Use completing-read's DEF argument
rather than INITIAL-INPUT, which is discouraged (see Elisp manual) and
may hide the other choices depending on the completion framework.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Ref: https://orgmode.org/list/CAJ51ETqO9A8mE0W3pgU2cFzaZsESdYXAV0X-8veY+_V9AwPHdQ@mail.gmail.com
2021-01-05 00:12:05 -05:00
Kyle Meyer e7fe57dde3 Merge branch 'maint' 2021-01-04 00:30:43 -05:00
Kyle Meyer 273391c978 duration: Avoid recursive load error
* 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
2021-01-04 00:30:00 -05:00
Kyle Meyer 291993888d Merge branch 'maint' 2021-01-01 15:02:10 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
TEC 7a9a8a56af org-plot.el: fix compiler warnings
* 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.
2020-12-23 22:03:11 -05:00
Kyle Meyer d631a51e01 org-attach: Silence byte-compiler
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.
2020-12-23 00:05:39 -05:00
Kyle Meyer 86184e2cb6 org-plot: Adjust pcase patterns for Emacs 24 compatibility
* lisp/org-plot.el (org-plot/gnuplot): Make recently introduced pcase
call compatible with Emacs 24.
2020-12-23 00:01:56 -05:00
Nicolas Goaziou d7270a2bbb Merge branch 'maint' 2020-12-22 14:56:37 +01:00
Nicolas Goaziou 97f1d8e340 element: Improve table.el tables dectection
* lisp/org-element.el (org-element--current-element): Limit possible
false positives.
2020-12-22 14:54:43 +01:00
Nicolas Goaziou f58c8003c3 Merge branch 'maint' 2020-12-22 12:44:39 +01:00
Nicolas Goaziou 118da7d280 element: Fix table.el tables parsing
* lisp/org-element.el (org-element--current-element): Fix regexp
matching a non-data-line.  Use rx.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-12/msg00561.html>
2020-12-22 12:43:48 +01:00
Bastien abedf386b3 lisp/org.el: Bump version to 9.4.4 2020-12-22 10:18:23 +01:00
Bastien bb54a9583c Merge branch 'maint' 2020-12-22 09:24:27 +01:00
Bastien 5e7c09e277 org-agenda.el and org-capture.el: Remove `generated-autoload-file'
* 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>
2020-12-22 09:22:14 +01:00
Nicolas Goaziou b6e5ca28ef lint: Remove unnecessary call to `tabulated-list-print'
* 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.
2020-12-19 11:52:52 +01:00
Ihor Radchenko de6d90224c org-attach: Consider inlinetasks when calculating attach dir
* 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.
2020-12-17 07:26:31 +01:00
Bastien 6bdb664406 lisp/ob-haskell.el: Add Lawrence Bottorff as maintainer 2020-12-17 06:47:14 +01:00
Marco Wahl 69760ae2e4 Merge branch 'maint' 2020-12-16 22:25:54 +01:00
Marco Wahl 6ec2bb04e3 org-macs: Improve navigation in org-mks window
* lisp/org-macs.el (org--mks-read-key): New function parameter
navigation-keys to enable navigation keys. M-v has been added to the
navigation keys.
(org-mks): Supress spurious output in minibuffer.

This commit is a reaction to
https://orgmode.org/list/trinity-b89ea3b3-3d0d-4648-bcfc-0054a4a7fdaa-1607976126186@3c-app-mailcom-bs08/
2020-12-16 22:15:39 +01:00
Ihor Radchenko baf1e7a644 ob-gnuplot: Fix error on non-string :var assignment
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): Consider that
not all the variable values must be a string in :var assignments.
2020-12-16 12:41:36 +01:00
Bastien 11d186a701 Fix previous commit 2020-12-16 10:42:39 +01:00
Bastien b9f92831bb Merge branch 'maint' 2020-12-16 10:42:17 +01:00
Bastien 86af7e0c2f lisp/org.el: Bump version to 9.4.3 2020-12-16 10:41:33 +01:00
Bastien a4e6a6fa77 lisp/org.el: Remove local variable `generated-autoload-file'
* lisp/org.el: Remove local variable `generated-autoload-file'.

Fix fae16ed8f and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45259.
2020-12-16 10:40:18 +01:00
Kyle Meyer b1dc454242 Merge branch 'maint' 2020-12-16 00:45:31 -05:00
Fatih Aydin 5ee39c3524 ox-html: Add margin to fix overflow visibility problem
* 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
2020-12-16 00:43:39 -05:00
Marco Wahl 864fe7e59a Merge branch 'maint' 2020-12-14 13:00:42 +01:00
Marco Wahl 01f57aa0df org-macs: Make org-mks window navigable when needed
* lisp/org-macs.el (org-mks): Activate keys for scrolling when the
whole text does not fit into the visible portion of the window.

https://orgmode.org/list/trinity-ac492dc8-9edb-46e6-871a-fdbb9eaa3116-1607796126691@3c-app-mailcom-bs06/
2020-12-14 12:56:42 +01:00
TEC a831e763fa org-plot.el: Make min/max keywords consistent
* lisp/org-plot.el: (org-plot/add-options-to-plist): Have both x/y
min/max, but have min/max aliased to the y-axis options.
2020-12-14 06:38:57 +01:00
TEC 90815cc948 org-plot.el: radar plot, join last points to first
* lisp/org-plot.el (org--plot/radar-template, org--plot/radar):
Duplicate first points at the end so that a line is drawn between them.
2020-12-14 06:38:56 +01:00
TEC a46cadfae3 org-plot.el: add missing cl- prefixes
* lisp/org-plot.el ( org--plot/merge-alists, org--plot/item-frequencies,
org--plot/prime-factors): Add missing cl- prefic to cl-lib functions
called.
(org--plot/radar): Refactor f function to remove dependency.
(org--plot/values-stats, org--plot/nice-frequency-pick): Autoformatting.
2020-12-14 06:38:55 +01:00
TEC c2fdf424a6 org-plot.el: avoid arithmetic overflow error
* 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.
2020-12-14 06:38:53 +01:00
TEC 1ac45d76e8 org-plot.el: complete transition to softcoded type
* 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'.
2020-12-14 06:38:52 +01:00
TEC 14a66b2b3a org-plot.el: fix logic error in transposition
* 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.
2020-12-14 06:38:51 +01:00
TEC 74f6a9610e org-plot.el: add radar plot type
* 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.
2020-12-14 06:38:50 +01:00
TEC 7b5113a3bc org-plot.el: tweak term, preamble custom vars
* 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.
2020-12-14 06:38:49 +01:00
TEC e905353d6e org-plot.el: add custom var for affecting the term
* 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.
2020-12-14 06:38:48 +01:00
TEC 73c99bf42d org-plot.el: add utility functions for range,ticks
* 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.
2020-12-14 06:38:47 +01:00
TEC bee7ef6f46 org-plot.el: abstract plot types into custom var
* 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.
2020-12-14 06:38:46 +01:00
TEC a1d92bd918 org-plot.el: add new custom gnuplot preamble
* 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.
2020-12-14 06:38:44 +01:00
TEC 8d5122fc5e org-plot.el: add new option :transpose
* 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.
2020-12-14 06:38:42 +01:00
TEC a64aa25fa5 org-plot.el: make indentation method consistent
* 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.
2020-12-14 06:38:39 +01:00
Bastien 349322161d lisp/ob-perl.el: Add Corwin Brust as maintainer 2020-12-14 06:25:28 +01:00
Bastien 162e0e3e6e lisp/org.el: Bump version to 9.4.2 2020-12-13 21:10:13 +01:00
Kyle Meyer f845305c31 Merge branch 'maint' 2020-12-13 14:56:59 -05:00
Juri Linkov 57a70d5053 ob-ruby.el: Funcall command if it's a function from inf-ruby-implementations
* 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
2020-12-13 14:54:09 -05:00
Kyle Meyer d7d714c7d5 Silence byte-compiler in Emacs repo
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.
2020-12-13 13:56:29 -05:00
Kyle Meyer 72f65744b7 Merge branch 'maint' 2020-12-12 23:17:51 -05:00
Kyle Meyer 8fafb71fea org-startup-options: Fix docstring typo
* lisp/org.el (org-startup-options): Fix docstring typo.
2020-12-12 23:17:30 -05:00
Kyle Meyer 5dc375434c Clean up spacing to pass Emacs's pre-commit check
* lisp/org-agenda.el (org-agenda-todo): Avoid space before tab in
indent.

This is in preparation for syncing with the Emacs repo.
2020-12-12 14:41:42 -05:00
Kyle Meyer 61f37f2e1a lisp/org.el: Bump version to 9.4.1
* lisp/org.el: Bump version to 9.4.1.
2020-12-12 14:34:08 -05:00
Gustav Wikström f6e41c1d14 org-id: org-id-get-with-outline-path-completion for file targets
* lisp/org-id.el (org-id-get-with-outline-path-completion): Make the
function work also for files (outline level 0)
2020-12-11 11:27:23 +01:00
Bastien 2bae9a3e49 Merge branch 'maint' 2020-12-11 08:58:06 +01:00
Bastien 7ce1a666d8 lisp/ob-abc.el: Fix link to William Waites homepage 2020-12-11 08:57:44 +01:00
Fatih Aydin dc1e037cd1 ox: Add Turkish translation
* lisp/ox.el (org-export-dictionary): Add Turkish translation.

TINYCHANGE
2020-12-10 23:24:02 -05:00
Kyle Meyer 25777d6e2c Merge branch 'maint' 2020-12-10 23:23:56 -05:00
Ihor Radchenko a03f17e49f Fix org-in-archived-heading-p
* 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.
2020-12-10 22:25:12 -05:00
Bastien 0571aa7010 lisp/ob-C.el: Add Thierry Banel as the maintainer 2020-12-10 12:13:24 +01:00
Gustav Wikström a71ac14e46 New startup options, #+startup: show<n>levels
* lisp/org.el (org-startup-folded, org-startup-options)
  (org-set-startup-visibility): Add new startup options
2020-12-10 10:35:59 +01:00
Kyle Meyer 752f01fdc6 Merge branch 'maint' 2020-12-10 00:49:20 -05:00
Kyle Meyer e04aa83309 refile: Update remaining spots that use obsolete org-copy
* lisp/org-refile.el (org-refile): Update docstring to refer to
org-refile-copy rather than obsolete alias org-copy.
2020-12-10 00:49:15 -05:00
Kyle Meyer cf02219e72 org: Reset saved scroll position on new cycling sequence
* 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.
2020-12-10 00:48:29 -05:00
Kyle Meyer 4f8ac0a7a3 org.el: Fix cycling hang when %p is in frame-title-format
* 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
2020-12-10 00:48:24 -05:00
Kyle Meyer 3e39f82cd4 Merge branch 'maint' 2020-12-08 23:50:56 -05:00
Kyle Meyer 2eb5f0741f org-fixup-indentation: Fix regression in logbook adjustment
* 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
2020-12-08 23:48:16 -05:00
Nicolas Goaziou 7c8dce72bd ox-latex: Improve handling of footnotes within verse blocks
* 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>
2020-12-05 10:05:46 +01:00
Kyle Meyer b0a3079970 Merge branch 'maint' 2020-12-04 00:36:08 -05:00
Stefan Kangas 706ba90195 Backport commit 0a4aa2894 from Emacs
* 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
2020-12-03 19:20:23 -05:00
Kyle Meyer f874644e5b Merge branch 'maint' 2020-11-30 23:52:09 -05:00
Kyle Meyer 3bb073b638 ol: Fix type error in org-link-search corner case
* 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
2020-11-30 23:49:48 -05:00
Kyle Meyer d1c7cd3ca4 Merge branch 'maint' 2020-11-28 17:21:35 -05:00
Kyle Meyer c974467fe5 org-goto: Explicitly load org.el and org-refile.el
* 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
2020-11-28 17:21:14 -05:00
Juri Linkov f7e286ab96 ob-ruby.el: Don't reuse the same buffer among different named sessions
* 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
2020-11-28 16:34:24 -05:00