Commit Graph

80 Commits

Author SHA1 Message Date
Paul Eggert 772c44779c Backport commit dd0727e1e from Emacs
* lisp/ol.el (org-store-link):
* lisp/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-macro.el (org-macro--vc-modified-time):
* lisp/org-macs.el (org-2ft, org-matcher-time):
* lisp/org-table.el (org-table-eval-formula):
* lisp/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Prefer (encode-time L) to (apply #'encode-time L) where either will do.
* lisp/org-clock.el (org-clocktable-steps):
Prefer (encode-time S M ...) to (apply #'encode-time (list S M ...)).

encode-time simplifications
dd0727e1ec1f535b9b06be88173b4d3ccd55abcb
Paul Eggert
Thu Dec 16 11:17:25 2021 -0800

[ km: Note that these changes will be reverted by the port of Emacs's
  8ef37913d. ]
2022-10-04 16:55:56 -04:00
Stefan Kangas 6e991f4bb9 Backport commit 10b691987 from Emacs
; Fix typos
10b69198708105655c49b62ac7d6185abb7e02a7
Stefan Kangas
Sat Jul 16 10:07:38 2022 +0200
2022-07-24 16:22:34 -04:00
Kyle Meyer 33543d2aa8 org-link-descriptive: Fix docstring typo
* lisp/ol.el (org-link-descriptive): Drop extra word from docstring.
2022-02-27 23:43:59 -05:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Glenn Morris ec22cf0a53 Backport commit 62d6cecfc from Emacs
* lisp/oc.el (org-cite-activate-processor)
(org-cite-export-processors, org-cite-follow-processor)
(org-cite-insert-processor):
* lisp/ol.el (org-link-parameters, org-link-frame-setup)
(org-link-shell-confirm-function)
(org-link-shell-skip-confirm-regexp)
(org-link-elisp-confirm-function)
(org-link-elisp-skip-confirm-regexp):
* lisp/org-num.el (org-num-format-function):
Remove bogus ":safe nil" that do nothing but propagate a
misunderstanding of the safe-local-variable property.

Remove bogus ":safe nil" custom properties
62d6cecfcd1a67e15a436c5c2b975f327d9a8b50
Glenn Morris
Sat Oct 2 10:46:29 2021 -0700
2021-10-02 13:56:50 -04:00
Bastien 769a557ceb Merge branch 'bugfix' 2021-09-25 18:17:46 +02:00
Ihor Radchenko 399481bad1 Do not ignore user-defined display-buffer-alist in org-insert-link
* lisp/ol.el (org-insert-link): Handle case when *Org Links* window is
not created.
* lisp/org-macs.el (org-no-popups): Do not override
`display-buffer-alist'. Use `pop-up-windows' instead.
2021-09-25 18:17:32 +02:00
Kyle Meyer f5392c4f2b Merge branch 'km/from-emacs-master' 2021-09-19 22:39:03 -04:00
Stefan Kangas b4ce4d6d82 Backport commit 25ebb9374 from Emacs
; More minor docfixes found by checkdoc
25ebb9374bdadf66153727831fc7ff131c8cf299
Stefan Kangas
Tue Sep 14 07:57:14 2021 +0200
2021-09-18 01:39:24 -04:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Bastien b4133552e1 lisp/ol.el: Enhance message when the link has already been stored
* lisp/ol.el (org-store-link): Enhance message when the link has
already been stored.
2021-05-16 09:54:28 +02:00
Ihor Radchenko 7dcb1afb69 Improve org-link-plain-re
* lisp/ol.el (org-link-make-regexps): Allow URLs with up to two
levels of nested brackets.

* lisp/org.el (org-link-plain-re): Update docstring.

* testing/lisp/test-ol.el: Add tests for the plain link regular
expression.

(org-link-plain-re): Update docstring.  Now,

Now, URLs like [1] can be matched.  The new regexp is based on [2].
The docstring of `org-link-plain-re'  explicitly mentions that the
regexp must contain groups for the link type and the path.

[1] https://doi.org/10.1016/0160-791x(79)90023-x
[2] https://daringfireball.net/2010/07/improved_regex_for_matching_urls
2021-05-15 16:13:49 +02:00
Ihor Radchenko f313b81841 Improve org-link-plain-re
* lisp/ol.el (org-link-make-regexps): Allow URLs with up to two
levels of nested brackets.

* lisp/org.el (org-link-plain-re): Update docstring.

* testing/lisp/test-ol.el: Add tests for the plain link regular
expression.

(org-link-plain-re): Update docstring.  Now,

Now, URLs like [1] can be matched.  The new regexp is based on [2].
The docstring of `org-link-plain-re'  explicitly mentions that the
regexp must contain groups for the link type and the path.

[1] https://doi.org/10.1016/0160-791x(79)90023-x
[2] https://daringfireball.net/2010/07/improved_regex_for_matching_urls
2021-05-15 10:33:23 +02:00
Bastien 0f2ece647b Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
Bastien eb3de47d25 Merge branch 'maint' 2021-05-06 14:40:38 +02:00
Bastien b4b35fc92d lisp/ol.el: Fix bug when storing links
* lisp/ol.el (org-store-link): Don' store two links when an a
radio link within a headline that contains a CUSTOM_ID property.

Reported-by: Fr Ml <fr_ml@t-online.de>
Link: https://orgmode.org/list/aadb23f3-c0fe-19aa-be79-50e51d16c41a@t-online.de/
2021-05-06 14:39:14 +02:00
Bastien Guerry ead3f5d498 Merge branch 'maint' 2021-04-30 08:52:13 +02:00
Aaron L. Zeng e2ffee96d2 ol.el: Fix confusing variable name
* ol.el (org-link--open-help): Fix a confusing variable name.  No
behavior changes.

TINYCHANGE
2021-04-30 08:51:54 +02:00
Nicolas Goaziou 10e22f57f7 ol: Inserting help links ask for description again
* lisp/ol.el (org-store-link): Allow a store function to
set :description to nil without falling back to link value.
(org-link--store-help): Set :description to nil.
2021-04-27 21:58:55 +02:00
Nicolas Goaziou beb010a3a5 ol: Fix storing link from a keybinding help buffer
* lisp/ol.el (org-link--store-help): Store the function attached to
the binding instead of the binding itself.
2021-04-27 17:50:18 +02:00
Nicolas Goaziou 3d353b0065 ol: Fix org-link--store-help
* lisp/ol.el (org-link--store-help): Read symbol without relying on
a hack.
2021-04-27 17:47:34 +02:00
Nicolas Goaziou 3b1467daa6 ol: Add missing docstring
* lisp/ol.el (org-link--store-help): Add missing docstring.
2021-04-27 17:28:39 +02:00
Nicolas Goaziou 4f8a2758cb ol: Factorize "help" link store function
* lisp/ol.el (org-link--store-help): New function.
(org-store-link): Do not hard-code "help" links. Use regular
`org-link-set-parameters' process.
2021-04-27 17:26:11 +02:00
Nicolas Goaziou 9ba4c95242 Add DOI links export
* lisp/ol-doi.el: New file.
* lisp/ol.el (org-link-doi-server-url): Move to new file.
(org-link--open-doi): Remove function.
* lisp/org.el (org-modules): Autoload new library for backward
compatibility.

Reported-by: yarnton--- via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
<http://lists.gnu.org/r/emacs-orgmode/2020-09/msg00908.html>
2021-04-18 14:02:06 +02: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
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 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
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 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
Kyle Meyer f845305c31 Merge branch 'maint' 2020-12-13 14:56:59 -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 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
Jack Kamm 5371b30fe5 ol.el: New option to set org-link-file-path-type to a function
* lisp/ol.el (org-link-file-path-type): Add new option.
(org-insert-link): Handle function option for org-link-file-path-type.
2020-11-11 17:00:25 -08:00
Max Nikulin 20aa3507af ol.el: Fix store and insert link in indirect buffer
* lisp/ol.el (org-store-link): Store link with CUSTOM_ID anchor
in indirect buffer.
(org-insert-link): Do not add file name to search and CUSTOM_ID
links pointed to the same file when called from indirect buffer.

When a subtree was open in an indirect buffer, wrong argument
of `abbreviate-file-name' prevented storing link to a CUSTOM_ID
anchor.  Internal link to a header line or to a CUSTOM_ID anchor
was created with file name instead of concise form.

This is a follow up of 784e5f1488.

TINYCHANGE
2020-09-04 17:59:21 +02:00
Bassam Saeed b395f0abf6 ol.el: Fixed typo
* lisp/ol.el (org-link-parameters): Fixed typo 'ar' to 'are'

TINYCHANGE
2020-08-02 00:07:34 -04:00
Bastien 6d62c76d2c ol.el: Allow to remove the link part of a link
* lisp/ol.el (org-link-make-string): When trying to make a link
with an empty link part, do not throw an error, just insert the
description text.
2020-05-23 17:07:35 +02:00
Nicolas Goaziou 7d35d46494 Fix :package-version values
* lisp/ol.el (org-link-email-description-format):
* lisp/org-src.el (org-src-tab-acts-natively):
* lisp/org-table.el (org-table-header-line-p):
* lisp/org.el (org-loop-over-headlines-in-active-region):
(org-fontify-done-headline): Use correct (PACKAGE . VERSION-STRING)
value.  Remove :version keyword since :package-version overrides it.
2020-05-06 02:12:23 +02:00
Nicolas Goaziou 3c4cb7b296 Merge branch 'maint' 2020-04-26 10:37:28 +02:00
Nicolas Goaziou f3c137a697 ol: Fix info links with backquotes and backslashes
* lisp/ol.el (org-store-link): Remove spurious backslash appearing in
some Info buffers.

Reported-by: Achilles Yuce <ayuce@posteo.mx>
<http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00405.html>
2020-04-26 10:36:39 +02:00
Nicolas Goaziou 7a78eb1be0 ol: Fix some corner cases when normalizing context in links
* lisp/ol.el (org-link--normalize-string): Handle blanks between
special characters.
(org-link-heading-search-string): Small refactoring.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-26 22:57:16 +01:00
Nicolas Goaziou 5b96988706 ol: Prettify suggested description for stored links
* lisp/ol.el (org-store-link): Remove statistics cookies and spurious
white spaces from description, if possible.
2020-03-24 12:32:21 +01:00
Nicolas Goaziou 6ea1ca51a8 ol: Refactor code for clarity
* lisp/ol.el (org-link--normalize-string): New function.
(org-link--squeeze-white-spaces, org-link--clear-syntax-from-context):
Remove functions (merged in the previous one).
(org-link-search):
(org-link-heading-search-string):
(org-store-link): Use new function.
2020-03-24 12:01:50 +01:00
Nicolas Goaziou 97e415c5df ol: Do not save tags when storing a link from a headline
* lisp/ol.el (org-link-heading-search-string): Assume optional
argument is already valid.  Remove TODO keyword, priority cookie,
COMMENT keyword, and tags.
(org-link-search): Remove COMMENT keyword.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-09 22:23:11 +01:00
Nicolas Goaziou 041138e47c Remove `org-export-link-as-file'
* lisp/ol.el (org-link-parameters): Remove reference to the function.
* lisp/ox.el (org-export-link-as-file): Remove function.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Remove test.

The current implementation is not satisfactory, and not useful in the
code base. Using a pre-export hook turning custom link type into
"file" is enough for now. See "attachement" links for an example.
2020-02-28 01:30:30 +01:00
Nicolas Goaziou 7707f898a1 ol: Fix opening file link with a starred search option
* lisp/ol.el (org-link-open-as-file): Fix logic so initial regexp is
matched against the file-name only, not the search option.
2020-02-26 16:29:32 +01:00
Nicolas Goaziou ee0dba6402 Small fix to headline search string
* lisp/ol.el (org-link-heading-search-string):
(org-link-search):
* lisp/ox.el (org-export-search-cells): Replace statistics cookies
with a space before squeezing spaces so as to handle properly, e.g.,
"wordCOOKIEword".
2020-02-23 12:51:07 +01:00