Commit Graph

23738 Commits

Author SHA1 Message Date
Kyle Meyer 2512fd702f Merge branch 'maint' 2021-02-05 01:21:05 -05:00
Kyle Meyer 61336f80dc mk/targets.mk: Add version fallback for tag-less repos
* mk/targets.mk (ORGVERSION, GITVERSION): Get version from lisp/org.el
header if it can't be retrieved from git-describe.

As of elpa.git's ee03829f90 (Finalize the new master branch,
2020-12-14), org-release and org-git-version are empty strings in
https://elpa.gnu.org/packages/org-*.tar files.  This is because the
new setup executes `make autoloads info' in an elpa.git worktree with
an Org branch checked out, but elpa.git of course doesn't have Org's
release tags.

Maintaining the org.el version header has been a point of contention
in the past [1], but the header has been there for a while now.  Use
it to avoid the above elpa.git issue.  In the case of the master
branch, the org-release value generated in a tag-less repo will have a
different version than the one from a regular repo because org.el's
version header has a "-dev" suffix, but that's still better than an
empty version.

[1] For example: https://orgmode.org/list/87zj1uhix6.fsf@gmx.us/

Reported-by: Pierre Langlois <pierre.langlois@gmx.com>
Ref: https://orgmode.org/list/87y2hi9qev.fsf@gmx.com
2021-02-05 01:20:09 -05: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
Kyle Meyer b99beaad18 org-macs: Add basic tests for org-matcher-time
* testing/lisp/test-org-macs.el (test-org-matcher-time): Add tests.

This includes of a test for the missing hour modifier added in the
previous commit.
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
stardiviner 3d80b5bff6
org-contacts.el: Display contacts buffer result.
* contrib/lisp/org-contacts.el (org-contacts-link-open): Display the
searched contacts file buffer.
2021-01-25 10:04:40 +08: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
Christian Garbs d02c0218ef testing/lisp/test-org-archive.el: Fix test
* testing/lisp/test-org-archive.el
(test-org-archive/datetree): Fix test for locales that don't use
English weekday names.
2021-01-14 00:15:34 -05:00
Ihor Radchenko 9ea7ff5e2f Fix typo in f948234cb 2021-01-10 17:13:38 -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
stardiviner 94d1753ec8
org-contacts.el: Fix store link function does not return link.
* contrib/lisp/org-contacts.el (org-contacts-link-store): Fix
org-store-link return incorrect link without link type prefix.
2021-01-05 19:30:36 +08:00
David Florness 38f143830c
org-contacts.el: Use `bound-and-true-p' to check (unbound) var
* org-contacts.el (org-contacts-link-store): Use `bound-and-true-p' to
check the truthiness of org-id-link-to-org-use-id, which may or may
not be bound depending on whether org-id has been loaded.  This
simplifies the code.
2021-01-05 19:28:11 +08: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
David Florness e6e1c08116
org-contacts.el: Only use org-id-store-link if org-id is loaded
Fixes bug introduced in 6b83c6e4e that made org-contacts-anniversaries
error if org-id was not loaded.
2021-01-05 01:33:20 +08: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
stardiviner c3888a8b74
org-contacts.el: replace obsolete alias `loop' with `cl-loop'
* contrib/lisp/org-contacts.el (org-contacts-get-icon): replace obsolete
alias `loop' with `cl-loop'.
2021-01-03 20:17:37 +08:00
stardiviner f948234cba
org-contacts.el: Add usage comments
* contrib/lisp/org-contacts.el: Add usage comments.
2021-01-03 20:16:41 +08: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
Kyle Meyer d84136f8db Merge branch 'maint' 2020-12-23 00:01:41 -05:00
Kyle Meyer bd1c3187cf .dir-locals.el: Set indent-tabs-mode to nil in Elisp sources
Despite .dir-locals.el having a catchall value of t for
indent-tabs-mode, Org's Elisp files are a mix of tabs and spaces.
Emacs has used a value of nil for indent-tabs-mode since 93d4412046
(Set indent-tabs-mode to nil in (most) Elisp sources, 2015-04-15).  Do
the same.

Ref: https://orgmode.org/list/87eejsg9vw.fsf@gnu.org
2020-12-23 00:00:26 -05:00