Commit Graph

24127 Commits

Author SHA1 Message Date
Stefan Kangas 3089fcd690 Remove redundant #' around lambdas
* contrib/lisp/org-choose.el (org-choose-get-highest-mark-index)
(org-choose-get-fn-map-group, org-choose-keep-sensible)
(org-choose-setup-vars):
* lisp/org-mouse.el (org-mode-hook, org-mouse-context-menu)
(org-mouse-popup-global-menu):
* lisp/ox-beamer.el (org-beamer--format-section):
* lisp/ox.el (org-export-insert-default-template): Remove redundant #'
around lambdas.
2021-03-30 23:54:22 -04:00
Kyle Meyer 1c0ce74a1f NEWS: Remove quote from in front of headline-data symbol
There's no need to quote the symbol when referring to it, just as
`symbol' rather than `'symbol' is used in docstrings.
2021-03-30 23:45:51 -04:00
Kyle Meyer d017cdb0ae NEWS: Group and move up electric-indent/adapt-indentation entries
Put the entry for "respecting electric-indent-mode" and the new value
of org-adapt-indentation near each other given that honoring
electric-indent-mode is likely to make many users aware of the
behavior that org-adapt-indentation controls (even if they weren't
aware that the option existed).

Also move these entries up in hopes of making them easier to discover.

Suggested-by: Tim Cross <theophilusx@gmail.com>
Ref: https://orgmode.org/list/87pmzhi7wp.fsf@gmail.com
2021-03-30 23:43:17 -04:00
Renato Ferreira 6a50e41ea5 org-agenda.el: Rename org-agenda-format-item parameters
* org-agenda.el (org-agenda-format-item): Rename parameters so they
don't clash with dynamic variables used by
`org-prefix-format-compiled'.

TINYCHANGE
2021-03-29 23:09:38 -04:00
Kyle Meyer 4d9dabc36f Merge branch 'maint' 2021-03-29 00:34:15 -04:00
Kyle Meyer 7c23fc7efa ob-ocaml: Update stale tuareg-mode link in commentary
Reported-by: Stefan Monnier <monnier@iro.umontreal.ca>
2021-03-29 00:33:49 -04:00
Maxim Nikulin 4de2fff87d Add quotes to emacsclient arguments in examples
* 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.
2021-03-29 00:32:29 -04:00
Maxim Nikulin a17243f9a5 org-manual.org: Fix typo in org-protocol capture example
* doc/org-manual.org: Use "&" as parameter separator in query part
of example for org-protocol capture URI.
2021-03-29 00:32:29 -04:00
Bastien 05277f5caf lisp/org.el: Fix previous merge commit 2021-03-28 17:54:50 +02:00
Bastien a169bdde3b Merge branch 'maint' 2021-03-28 17:54:17 +02:00
Bastien 287af207fe lisp/org.el: Bump version header to 9.4.5 2021-03-28 08:36:11 +02:00
Kyle Meyer 7a62a4d325 Merge branch 'maint' 2021-03-27 02:21:07 -04:00
Kyle Meyer e2e89cea87 Merge branch 'km/from-emacs-master' 2021-03-27 02:20:45 -04:00
Basil L. Contovounesios f10773675d Backport commit 331ddd803 from Emacs
* lisp/org-macs.el (org--string-from-props): Pacify warnings
about unknown functions in non-GUI bilds.

Address some --without-x byte-compilation warnings
331ddd803a72056d0f0c70e5a677e0d4a6300584
Basil L. Contovounesios
Fri Mar 26 17:35:34 2021 +0000
2021-03-27 02:18:35 -04:00
Sébastien Miquel 36622362d1 org.el (org-do-latex-and-related): Fix duplicate 'latex faces
* lisp/org.el (org-do-latex-and-related): Do not add a
'org-latex-and-related face beyond the fontification limit.
2021-03-27 02:05:30 -04:00
Stefan Kangas b7c26e9036 Backport commit 8b07994e2 from Emacs
Convert many more links to use HTTPS
8b07994e201e478df8a3431cbae5187b4cde1791
Stefan Kangas
Wed Mar 24 10:20:18 2021 +0100
2021-03-25 00:56:53 -04:00
Kyle Meyer 68db6fc064 Merge branch 'maint' 2021-03-25 00:53:11 -04:00
Kyle Meyer 478929ae61 ox-html: Fix org-html-format-drawer-function's docstring
* 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
2021-03-24 22:45:22 -04:00
Kyle Meyer 4f98c86b3b manual: Grammar fix
* doc/org-manual.org (Publishing action): Fix conjugation.
2021-03-24 22:24:59 -04:00
Greg Minshall d156399445 Update example :publishing-function names in manual
* doc/org-manual.org (Publishing action): Fix references to
org-latex-publish-to-pdf and org-org-publish-to-org.
2021-03-24 22:24:55 -04:00
Bastien c5538d58c4 mk/default.mk: Use Emacs manual css for Org online manual
Thanks to TEC <tecosaur@gmail.com> who suggested this.
2021-03-24 09:06:09 +01:00
Stefan Kangas 2e1c984153 Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
Stefan Kangas 8cc992f7b2 Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
Kyle Meyer c1fa5ea76f Merge branch 'maint' 2021-03-21 13:41:39 -04:00
Kyle Meyer 5450d64202 ob-export: Give more informative error on unknown call reference
* 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
2021-03-21 13:41:31 -04:00
Maxim Nikulin 5db61eb0f9 org.el: Avoid xdg-open silent failure
* 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
2021-03-21 10:38:39 -04:00
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
Kyle Meyer 17e27ea634 Merge branch 'maint' 2021-03-19 00:40:26 -04:00
Kyle Meyer dbc84311c0 ob-smiles.el: Fix reference to free variable
* contrib/lisp/ob-smiles.el (molecule-jump): Format string with NAME
argument rather than undefined variable `path'.
2021-03-19 00:39:09 -04:00
Lein Matsumaru 1738b455b3 ob-smiles.el: Update org babel API
* contrib/lisp/ob-smiles.el (org-link): Fix from org-add-link-type to
org-link-set-parameters

TINYCHANGE
2021-03-19 00:39:09 -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
Kyle Meyer 4de1e053d1 test-ob-sqlite.el: Don't load ob-sqlite
* testing/lisp/test-ob-sqlite.el (ob-sqlite): Don't explicitly load
ob-sqlite.

ob-LANG tests check whether the corresponding ob- feature is
available, signaling missing-test-dependency if it's not.  Which ob-
libraries are loaded/tested can then controlled by the Makefile
variable BTEST_OB_LANGUAGES.

test-ob-sqlite.el, however, requires ob-sqlite before its featurep
call, unconditionally loading ob-sqlite and breaking the above setup.
2021-03-16 23:53:09 -04:00
Kyle Meyer be35212683 Merge branch 'maint' 2021-03-16 23:52:34 -04:00
Kyle Meyer e07cb2ad3c manual: Fix org-latex-listings reference in footnote
* doc/org-manual.org (Footnotes): Refer to org-latex-listings instead
of org-export-latex-listings.

The last occurrence of org-export-latex-listings was deleted with the
contrib/oldexp/ removal in Org 8.
2021-03-16 23:52: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
Kyle Meyer 06dc62790e Merge branch 'maint' 2021-03-14 22:07:25 -04:00
Kyle Meyer 7470ee93a6 test-org-clock: Avoid daylight saving time failure
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/match):
Shift times away from the beginning of the day to avoid unexpected
time totals due to DST changes.

test-org-clock/clocktable/match fails today in the US because at 2:00
clocks jumped to 3:00, and the total time check uses the range
2:00-4:00.
2021-03-14 22:06:22 -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
Kyle Meyer 4d463ee4ba ORG-NEWS: Add entry for org-clock-ask-before-exiting 2021-03-03 22:51:09 -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
Kyle Meyer d726503251 Merge branch 'maint' 2021-03-02 01:14:26 -05:00
Kyle Meyer b712b9618a manual: Add publishing-function to publishing example
* doc/org-manual.org (Example: simple publishing configuration): Add
:publishing-function to org-publish-project-alist.

This appears to have been necessary since 0ccf650b4 (org-e-publish:
Remove default value for publishing function, 2012-10-08).

Reported-by: dalanicolai <dalanicolai@gmail.com>
Ref: https://orgmode.org/list/CACJP=3k2jL1z0d-uALFGoutffFF2o=7-L39zUns6si0KAhZ-_g@mail.gmail.com
2021-03-02 01:13:11 -05:00