Commit graph

23705 commits

Author SHA1 Message Date
Bastien 15200c25d5 doc/org-manual.org: Small rephrasing
* doc/org-manual.org (Features Overview): Small rephrasing.

Reported-by: Ian Nehera <delta29@shaw.ca>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47738
2021-05-06 12:10:25 +02:00
Bastien 4b553e5d70 doc/org-manual.org (List of Contributions): Add Timothy E Chapman
* doc/org-manual.org (List of Contributions): Add Timothy E Chapman.
2021-05-05 13:56:05 +02:00
Nicholas Savage f8ee4ab4a7 lisp/ob-sqlite.el: Prevent output from being incorrectly parsed if it contains double-quotes.
* lisp/ob-sqlite.el (org-babel-sqlite--read-cell): New function.
(org-babel-sqlite-table-or-scalar): Use `org-babel-sqlite--read-cell'
instead of `org-babel-string-read' to prevent data from being ignored
if it contains double-quotes.

Reported-by: learnorchids@gmail.com
Link: https://orgmode.org/list/CAK5xwica4i8h09ObzCVPx2pe-T6B0_ju_MXiduRiY7GH+PkE_A@mail.gmail.com/
2021-05-04 22:44:22 +02:00
Bastien b718b7035d lisp/org.el (org-indent-line): Add missing arg to `looking-back'
* lisp/org.el (org-indent-line): Add missing arg to `looking-back'.
2021-05-04 22:23:51 +02:00
Bastien eecc0574d8 lisp/org-agenda.el: Prevent wrong scrolling
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
2021-05-04 00:22:33 +02:00
Bastien dfc0d522f1 Revert "lisp/org-agenda.el: Prevent wrong scrolling"
This reverts commit eca93742b6.
2021-05-04 00:20:07 +02:00
Bastien eca93742b6 lisp/org-agenda.el: Prevent wrong scrolling
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
2021-05-03 22:27:48 +02:00
Mingkai Dong dfdd5cd0cd lisp/ox-html.el: Finish the headline numbering part by a full stop
* lisp/ox-html.el (org-html-headline): Finish the numbering part
with a full stop, to be consistent with the TOC numbers.

TINYCHANGE

Link: https://orgmode.org/list/2F46C11A-B2CD-445C-A811-CB05A043FE46@dong.mk
2021-05-03 19:10:52 +02:00
Bastien de93bf02bf lisp/org.el: More fixes to `org-indent-line'
* lisp/org.el (org-indent-line): Fixes indentation.
(org--get-expected-indentation): Don't handle the 'headline-data
value for `org-adapt-indentation' here, it is taken care upstream
in `org-indent-line'.
2021-05-03 16:25:24 +02:00
Nicholas Savage 238a80d3ad org-colview.el (org-columns): Replace org-map-entries with org-scan-tags
* lisp/org-colview.el (org-columns): Replace call to `org-map-entries'
to build cache with `org-scan-tags'.

Simplifies `org-columns' to call `org-scan-tags' instead of
`org-map-entries'.  This is to fix a bug where an unexpected non-existent
agenda file error was thrown if the buffer that `org-columns' was called
on was not yet saved to disk.  This also simplifies `org-columns' and
prevents unnecessary agenda preparation functions from running.
2021-05-03 15:59:39 +02:00
Bastien ba9e531016 lisp/org.el: Fix another indentation case
* lisp/org.el (org-indent-line): With `org-adapt-indentation' set
to 'headline-data, don't indent after a headline, a planning line
or a drawer.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Link: https://orgmode.org/list/878s4wu9oe.fsf@gmail.com/T/#m658a98441dcce099a569ca5b228778aad5d102f3
2021-05-03 10:04:57 +02:00
Bastien 445be13972 lisp/org.el: Fix indentation again
* lisp/org.el (org-indent-line): Take care of checking at the
beginning of the line.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Link: https://orgmode.org/list/878s4wu9oe.fsf@gmail.com/T/#m658a98441dcce099a569ca5b228778aad5d102f3
2021-05-03 09:59:54 +02:00
Bastien e7fc34ecf4 lisp/org.el: Update docstring of `org-return-and-maybe-indent'
* lisp/org.el (org-return-and-maybe-indent): Update docstring to
reflect the current behavior.
2021-05-03 08:56:47 +02:00
Bastien c3917c3a0b lisp/org.el (org-indent-line): Fix another bug
* lisp/org.el (org-indent-line): When `org-adapt-indentation' is
'headline-data, prevent indentation for any first non-empty line
after the headline, not just the one right after the headline.
2021-05-03 08:46:37 +02:00
Bastien c7331f859d lisp/org.el: Fix indentation when `org-adapt-indentation' is 'headline-data
* lisp/org.el (org--get-expected-indentation): Fix indentation of
non-headllines with `org-adapt-indentation' set to 'headline-data.
(org-indent-line): When `org-adapt-indentation' is 'headline-data,
don't indent when point is at the first line after a headline.
Update the docstring to make it explicit that indenting relatively
to current level only happens when `org-adapt-indentation' is set
to `t'.
2021-05-03 06:23:03 +02:00
Ihor Radchenko 4c76962814 lisp/org.el: Don't fontify headlines with "::" as description items
* lisp/org.el (org-set-font-lock-defaults): Avoid fontifying headlines
with "::" as description list items.

Lists can start with "*", but "*" must not be at the beginning of
line.  Old regexp did not require whitespace before "*" in description
list items.

Reported-by: Ypo <ypuntot@gmail.com>
Link: https://orgmode.org/list/5adcfcda-35de-8281-a1ff-18d1c95bbde6@gmail.com/
2021-05-02 19:29:23 +02:00
Nicholas Savage cb0ef12801 lisp/org-colview.el: Update org-columns to respect global-visual-line-mode
* lisp/org-colview.el (org-columns): Prevent enabling `truncate-lines'
when `global-visual-line-mode' is enabled.

This fixes a bug where `org-columns' overlays were disabling wrapping
of lines when `global-visual-line-mode` was already activated, and so
therefore expectation was that the lines would continue wrapping.
This is because `org-columns' was setting truncate-lines to t, when
global-visual-line-mode requires it to be set to nil. The interaction
between the two caused the wrapping not to occur.
2021-05-02 19:21:26 +02:00
Nicolas Goaziou ab82d6ae25 ox-ascii: Fix title when 2 width char is used
* lisp/ox-ascii.el (org-ascii-template--document-title): Find width of
title with `string-width' instead of counting characters.

Fixes: #48148

Reported-by: Shingo Tanaka <shingo.fg8@gmail.com>
2021-05-02 17:48:47 +02:00
Ihor Radchenko 0e7153e63d org-test: Fix wrong-numbre-of-arguments error on master+native-comp
* testing/org-test.el (org-test-at-time): Use correct number of
arguments in 'decode-time cl-letf binding. `decode-time' accepts up to
3 arguments on master.

The wrong-numbre-of-arguments error is raised on Emacs master
configured with native-comp support when running make test on Org mode
master.  Native-comp modifies function calls with optional arguments
in the way that omitted arguments are still provided as `nil'.  For
example, `decode-time' called as (decode-time time) in lisp source may
be compiled into (decode-time time nil nil) call by native-compiler.
If redefined `decode-time' does not accept 3 arguments, it result in
error.

See Emacs bug#48133.
2021-05-02 11:06:32 +02:00
Bastien 5584ffc6c4 lisp/org.el (org--backward-paragraph-once): Handle corner case
* lisp/org.el (org--backward-paragraph-once): Don't throw an error
when at the first headline after a single empty line.
2021-05-02 08:49:53 +02:00
Bastien 5021bada95 lisp/org.el: Fix bug when unfolding a subtree
* lisp/org.el (org-cycle-internal-local): Use 'tree instead of
'canonical when setting the visibility of the subtree to unfold.

Reported-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
Link: https://orgmode.org/list/CAELBRWLakDCbawmMdS5Qi0qh5FC2ixF82xNfCg75wMjmze6pbA@mail.gmail.com/
2021-05-02 07:09:55 +02:00
Bastien eedbe286ef lisp/org-table.el: Fix bug with `org-table-wrap-region'
* lisp/org-table.el (org-table-copy-region): Only display a
message when called interactively.
(org-table-wrap-region): Prevent `org-table-cut-region' from
losing track of the region beginning.

Reported-by: Marko Schuetz-Schmuck <marko.schutz@upr.edu>
Link: https://orgmode.org/list/875z84fnwv.fsf@tpad-m.i-did-not-set--mail-host-address--so-tickle-me/
2021-05-02 05:44:46 +02:00
Bastien ccd513a3c5 lisp/org.el: Don't let `visual-line-mode' override Org's keybindings
* lisp/org.el (org-mode): Don't let `visual-line-mode' override
Org's keybindings for C-a, C-e and C-k.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87a6zkv3m2.fsf@gmail.com/
2021-05-01 22:24:57 +02:00
Kyle Meyer 94837fc6b5 agenda: Fix org-agenda-show-new-time on Emacs 24
* lisp/org-agenda.el (org-agenda-show-new-time): Add fallback for when
window-font-width isn't available.

efbf96389 (org-agenda.el: Fix display of agenda new time, 2020-02-02)
reworked the column calculation to use window-font-width, but that
function isn't available until Emacs 25, and it's definition can't be
easily ported to org-compat.

Instead just use the old logic, which had been in place since v8.2.6,
when window-font-width isn't available.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 15:48:11 -04:00
Kyle Meyer 8bd3bd093b ob-C: Adjust pcase pattern for Emacs 24 compatibility
* lisp/ob-C.el (org-babel-C-header-to-C): Switch pcase patterns to
"`X" rather than "'X", which isn't supported until Emacs 25.

These were introduced by 38f87a26b (ob-C.el: Fix a number a
regressions related to table parameters, 2021-04-29).

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 15:43:01 -04:00
Ihor Radchenko 0a8079b4d7 Bypass read-only state in org-entry-put
* lisp/org.el (org-entry-put): Ignore read-only state of the buffer.

Fixes bug when ID property is not insered when creating ID in an
indirect read-only org-goto buffer. [1]

[1] https://orgmode.org/list/8ffe2da5-e2cb-f44c-0a46-b19873c0bdf2@gmx.de/
2021-05-01 18:45:15 +02:00
Bastien Guerry 842ab092ae lisp/org.el: Make `org-toggle-link-display' more consistent
* lisp/org.el (org-do-emphasis-faces): Don't hide with `org-link'
as the value for the invisible text property.

Before this commit, M-x org-toggle-link-display RET would also toggle
the emphasis markers.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87o8jnzjao.fsf@gmail.com/
2021-05-01 18:38:31 +02:00
Bastien Guerry fb30301888 lisp/org.el: Fix bug about inserting a heading before the first headline
* lisp/org.el (org-insert-heading): Fix bug when inserting a
heading before the first headline.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/875z73br32.fsf@gmail.com/
2021-05-01 17:59:20 +02:00
Ivan Sokolov 45ca597f96 lisp/ob-sql.el: Prevent from getting stuck with an error
* lisp/ob-sql.el (org-babel-edit-prep:sql): Prevent from getting
stuck with an error.

TINYCHANGE
2021-05-01 12:26:38 +02:00
Bastien Guerry 80a676c722 Revert "org: Add font-lock rule for inline export snippets"
This reverts commit 9af8d55f07.
2021-05-01 12:00:08 +02:00
TEC 9af8d55f07 org: Add font-lock rule for inline export snippets
* lisp/org.el (org-set-font-lock-defaults): Add font-lock rule for
inline export snippets.
2021-05-01 11:59:46 +02:00
TEC 400d2d9fd7 org-src: Use point instead of column for coords
* lisp/org-src.el (org-src--coordinates)
(org-src--goto-coordinates): Use point instead of column.

Using a column-based approach fails to account for invisible regions
or display overlays that change the number of columns: for example,
showing a LaTeX \alpha as α.  In src edits which involve such
structures, this causes the point to be shifted undesirably.  By using
a point-based approach this issue does not occur.
2021-05-01 11:57:27 +02:00
Anthony Carrico dcd7b576b7 lisp/ox-html.el (org-html-scripts): Small refactoring
* lisp/ox-html.el (org-html-scripts): Small refactoring.

This replays the Javascript refactoring of commit 471054136.

Link: https://orgmode.org/list/498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org/
2021-05-01 11:12:51 +02:00
Bastien Guerry d18071b4ff lisp/org-agenda.el: Make tags filtering case-sensitive
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-get-represented-tags)
(org-agenda-filter-make-matcher-tag-exp): Make tags filtering
case-sensitive.

This fixes a bug introduced in commit 13a1a4fb9.
2021-05-01 08:33:20 +02:00
Pablo Barraza Cornejo 390063d8df ox-html.el/inline-image export: Fix caption numbering
* lisp/ox-html.el (org-html-standalone-image-p): Remove quote which
causes `org-html-standalone-image-p' to not check if
`org-html-standalone-image-predicate' is fbound and see if it's
initialized.

TINYCHANGE
2021-05-01 00:38:39 -04:00
Kyle Meyer df84100d0c org-display-inline-images: Silence byte-compiler on Emacs <26
* lisp/org.el (org-display-inline-images): Guard image-map use with
boundp check rather than version check.

Guarding with a boundp will pacify the byte-compiler and is a direct
check that the thing we care about is available, so there's no need to
rely on the version check.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 00:38:39 -04:00
Kyle Meyer 869b7a21b9 org-open-file: Avoid make-process for Emacs 24 compatibility
* lisp/org.el (org-open-file): Select a pipe connection type with
process-connection-type rather than make-process, which isn't
available until Emacs 25.

This uses the alternative approach suggested by Eli Zaretskii in the
thread that led to 5db61eb0f (org.el: Avoid xdg-open silent failure,
2021-03-21): https://orgmode.org/list/83y2g96ta6.fsf@gnu.org

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 00:38:39 -04:00
Kyle Meyer 45a3d7a900 org-tags-expand: Mark unused argument to silence byte-compiler
* lisp/org.el (org-tags-expand): Mark DOWNCASED as unused.
2021-05-01 00:07:09 -04:00
Nicolas Goaziou e266fac1ed ox-texinfo: Property display images with relative file names
* lisp/ox-texinfo.el (org-texinfo--inline-image): Make sure to remove
leading "./" from file name.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00873.html>
2021-04-30 15:50:25 +02:00
Dr. Arne Babenhauserheide 8ab1e30dbc contrib/lisp/ox-rss.el (org-rss-headline): Handle empty date
* contrib/lisp/ox-rss.el (org-rss-headline): Handle empty date.

TINYCHANGE
Reported-by: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
Link: https://orgmode.org/list/875z49echi.fsf@web.de/
2021-04-30 09:03:10 +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
tbanel 38f87a26b5 ob-C.el: Fix a number a regressions related to table parameters
* ob-C.el (org-babel-C-expand-C, org-babel-C-header-to-C,
org-babel-C-expand-D): Add a `TYPE' parameter to
`org-babel-C-header-to-C' so that the helper functions return the
correct type.  Previoulsy for tables of non-strings the helper
functions would attempt to return a string, leading to compilation
errors.

* ob-C.el (org-babel-C-header-to-C): Correctly quote header elements.
Before, if the elisp value was not a string, it would not quote it,
leading to a syntax error.

* ob-C.el (org-babel-C-utility-header-to-C): Include `string.h' in
header `get_column_num' requires `strcmp', leading to compilation
errors.

* ob-C.el (org-babel-C-var-to-C): prefered declaration of a table in D
differs from C and C++. Example in C: `int table[2][3] = ...;'. In D:
`int[3][2] table=...;'

This patch is mainly based on Asa Zeren <asaizeren@gmail.com> patch of
Nov 5 2020, which was not commited at that time.
2021-04-29 15:31:51 +02:00
Maxim Nikulin 24a7ed50b3 org-protocol.el: Fix detection of old-style URIs
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol): Avoid
incorrect regexp in check whether command line argument uses new syntax.
Fix failures of org-protocol tests.

Question mark was not escaped in the previous version 928e67df7e,
so any string was matched by lazy "*".  Match in never used,
thus `string-match-p` would be better, but actually regexp is redundant
here.

It is not documented what browser or desktop environment adds extra
slash before "?".  Accordingly to
mid:A2B0655F-BF28-4943-BC05-99021BFDA1B3@robewald.de, Windows may be
involved.  Likely it happens with double slash after schema as in
org-protocol://capture?url=URL&title=TITLE due to subprotocol is
considered as host name and URI is normalized by adding a slash
as mandatory path part before "?" query.  So just reverting the original
commit will likely cause a regression.  Another guess is that
with single or triple slash (org-protocol:/capture?url=URL)
subprotocol is a part of path thus no "smart" actions are necessary.
2021-04-28 09:23:22 +02:00
Maxim Nikulin 5e8f039aaa test-org-protocol.el: Fix the case for parse parameters with complex argument
* testing/lisp/test-org-protocol.el
(test-org-protocol/org-protocol-parse-parameters): Specify that the case
simulating real life capture uses new style parameters string
to prevent test failure.

It looks like a typo survived since addition of this case in 2216f4d2c7.
2021-04-28 09:11:05 +02:00
Bastien Guerry ebcee052fd Revert "org.el (org-sort-remove-invisible): Remove spurious spaces"
This reverts commit 5be650714d.
2021-04-28 08:48:29 +02:00
Juan Manuel Macias 5be650714d org.el (org-sort-remove-invisible): Remove spurious spaces
* org.el (org-sort-remove-invisible): Remove spurious spaces.

TINYCHANGE
2021-04-28 07:45:05 +02:00
David Asabina 08e62edb3a org-protocol: Fix missing '+' in js snippet
* org-protocol (org-protocol-capture): Add missing plus-sign to
javascript snippet to allow readers of the doc string to use example
snippet with minimal edits.

TINYCHANGE
2021-04-28 07:38:08 +02:00
Nicolas Goaziou e9f03779bc ol-info: Fix description when storing "info" link
* lisp/ol-info.el (org-info-store-link): Fix typo.

Reported-by: Alex <alex.giorev@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00696.html>
2021-04-27 23:26:55 +02:00
Bastien Guerry b1ff9afc3b ox.el: Remove .gpg extension from the exported file-name
* ox.el (org-export-output-file-name): Remove .gpg extension.

Reported-by: Adalricus Ovicula <adalricus@inventati.org>
Link: https://orgmode.org/list/87a74x7g6v.fsf@xenon.ovicula/

This is a rework of the previous reverted commit e8c24b66a.
2021-04-27 10:21:05 +02:00
Bastien Guerry 82707041b0 Revert "ox.el: Remove .gpg extension from the exported file-name"
This reverts commit e8c24b66af.
2021-04-27 10:16:13 +02:00