Commit graph

5317 commits

Author SHA1 Message Date
Marco Wahl d0b55739c0 org: Fix: Respect TAB in property drawer as separator
* lisp/org.el (org-property-drawer-re): Allow TAB as first
character after the property name's colon.
2021-10-11 14:08:01 +02:00
Kyle Meyer f0c66dc4c4 Merge branch 'bugfix' 2021-10-09 16:18:17 -04:00
Nicholas Vollmer b71474ff7f lisp/org.el: (org-save-all-org-buffers): Prevent `org-mode' reload
* lisp/org.el: (org-save-all-org-buffers): Ensure `save-some-buffers' PRED returns boolean.

As of this upstream commit:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a9ad3d477441feefa3bf6107d58281cb64e0e78a

`save-some-buffers' will call its PRED argument if it returns a function.
Since (derived-mode-p 'org-mode) returns the symbol org-mode,
and org-mode is a function, org-mode is reloaded in modified Org
buffers when calling `org-save-all-org-buffers'. Among other
undesirable behavior, this will cause the buffer's visibility to be
reset to its initial visibility.
2021-10-09 15:23:33 -04:00
Kyle Meyer cc2490a706 Prune Emacs 25.1 compatibility kludges
* lisp/oc-basic.el (org-cite-basic--field-less-p):
* lisp/ol-eww.el (org-eww-store-link):
* lisp/org-agenda.el (org-agenda-check-clock-gap):
* lisp/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve-clock, org-clock-resolve)
(org-resolve-clocks, (org-resolve-clocks-if-idle)
(org-clock-in, org-clock-sum): Drop now unnecessary use of
compatibility functions.

* lisp/org-compat.el (org-string-collate-lessp, org-decode-time)
(org-format-time-string, org-link-escape-browser, org-time-add)
(org-time-subtract, org-time-since, org-time-less-p): Mark as
obsolete.

The 9.5 release declared Emacs 25.1 as the minimum version.
2021-10-04 23:43:14 -04:00
Kyle Meyer 2893eb1ae2 org.el: Drop subtract-time -> time-subtract alias
time-subtract has been available since Emacs 22.1.
2021-10-04 23:41:02 -04:00
Kyle Meyer 06578d7450 Merge branch 'bugfix' 2021-10-02 13:48:07 -04:00
Kyle Meyer df7b0eac13 Merge branch 'km/from-emacs-28' into bugfix 2021-10-02 13:45:37 -04:00
Glenn Morris c3e8709e2d Backport commit f9111d878 from Emacs
* lisp/oc-basic.el (org-cite-basic-sorting-field)
(org-cite-basic-author-year-separator)
(org-cite-basic-max-key-distance)
(org-cite-basic-author-column-end)
(org-cite-basic-column-separator)
(org-cite-basic-mouse-over-key-face):
* lisp/oc-biblatex.el (org-cite-biblatex-options):
* lisp/oc-csl.el (org-cite-csl-link-cites)
(org-cite-csl-html-hanging-indent)
(org-cite-csl-html-label-width-per-char)
(org-cite-csl-latex-hanging-indent):
* lisp/oc.el (org-cite-adjust-note-numbers):
* lisp/org-keys.el (org-return-follows-link):
* lisp/org.el (org-fontify-todo-headline):
* lisp/ox-html.el (org-html-equation-reference-format)
(org-html-wrap-src-lines):
* lisp/ox-latex.el (org-latex-reference-command)
(org-latex-default-quote-environment): Fix :safe property.

The safe-local-variable property is a function (bug#50944)
f9111d8784bf12263abbe127cdfcbe5f409c9b3b
Glenn Morris
Sat Oct 2 10:37:42 2021 -0700
2021-10-02 13:44:34 -04:00
Kyle Meyer 9e71dfd921 Merge branch 'bugfix' 2021-10-02 00:55:26 -04:00
Ihor Radchenko fa315986a1
org-do-emphasis-faces: Never treat closing marker as next opening marker
* lisp/org.el (org-do-emphasis-faces): Make sure that we never match
ending marker of an emphasis as a beginning marker of another
emphasis.  For example, in "(~-~) test (~+~)" "~) test (~" is a valid
code match unless we move point to the end the first code emphasis
completely during parsing.

Fixes https://orgmode.org/list/87fsujp7mc.fsf@web.de
2021-10-02 12:47:42 +08:00
Bastien 35928a6d09 lisp/org.el: Update the Version header to 9.6-dev 2021-09-30 06:46:53 +02:00
Sébastien Miquel 10139c86bc org.el (org-create-formula-image): Fix ignored background color
* lisp/org.el (org-preview-latex-process-alist): add a
`:transparent-image-converter' property for `dvipng'.
(org-create-formula-image): If available, use
`:transparent-image-converter' when no background color is set.
2021-09-30 06:46:31 +02:00
TEC 55cf527375
org: Image display, account for line number width
* lisp/org.el (org-display-inline-image--width): To be slightly more
accurate when calculating image widths that are proportional to the text
width in the current buffer, subtract the width taken up by line numbers.
2021-09-29 21:40:35 +08:00
Bastien 0a86adc127 lisp/org.el: Set version header to 9.5 2021-09-29 14:24:53 +02:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00
Bastien 519947e508 * lisp/org.el: Require Emacs 25.1.
lisp/org.el: Require Emacs 25.1

See https://orgmode.org/worg/org-maintenance.html#emacs-compatibility
2021-09-29 08:52:04 +02:00
Bastien 93d7825d55 lisp/org.el (visual-fill-column-width): Silence compiler warning
* lisp/org.el (visual-fill-column-width): Silence compiler warning.
2021-09-28 17:31:18 +02:00
TEC 663255e25e org: Remove obsolete default LaTeX packages
* lisp/org.el (org-latex-default-packages-alist): Remove grffile and
textcomp from the list of default LaTeX packages to load, as they've
been obsolete for quite a few years now.

* etc/ORG-NEWS: Announce the removal of grffile and textcomp from
`org-latex-default-packages-alist'.
2021-09-27 18:40:08 +02:00
Ihor Radchenko db167b9999
Do not use mark-whole-buffer noninteractively
* lisp/org.el (org-fill-element): `mark-whole-buffer' introduced in
7b85a64da is only for interactive use and causes compiler warning.
Replace it using noninteractive commands.
2021-09-27 22:31:01 +08:00
Bastien 981bcbfc14 Merge branch 'bugfix' 2021-09-27 14:47:41 +02:00
Bastien d13556e5ed lisp/org.el (org-return): Enable `delete-selection'
* lisp/org.el (org-return): Enable `delete-selection'.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
<https://list.orgmode.org/87zgvz6lz7.fsf@gmail.com/>
2021-09-27 14:47:11 +02:00
TEC c90f96c00d
org: Support displaying X% width images
* lisp/org.el (org-display-inline-image--width): Instead of interpreting
an image :width of X% as X pixels, take it as X% of the text width of
the buffer.
2021-09-27 20:18:50 +08:00
TEC c76a7eed23
org: Refactor width in `org-display-inline-images'
* lisp/org.el (org-display-inline-images,
org-display-inline-image--width): Extract the width determination in
`org-display-inline-images' into a new function
`org-display-inline-image--width' where I have taken the opportunity to
refactor the width-determination code.
2021-09-27 20:17:49 +08:00
TEC e816ae1ff5
org: Display proportional image widths
* lisp/org.el (org-display-inline-images): When the image width is given
as a float less than 2, interpret the value as that portion of the text
area width.  This works well with cases such as "#+attr_latex: :width
0.6\linewidth" as this will now be interpreted as 60% of the text area
width.  The upper bound is set to 2 not 1, as more than 100% of the text
width can be realistic, e.g. "1.2\linewidth" in LaTeX, but more than
200% seems unrealistic.
2021-09-27 19:57:57 +08:00
Bastien c21dceb66d lisp/org.el: Fix some compiler warnings
Thanks to Ihor Radchenko for reporting them.
2021-09-26 22:14:47 +02:00
Max Nikulin 87a8229b4a org.el: Use org-contrib module instead of CONTRIB dir in docs
* lisp/org.el (org-modules, org-export-backends): Update docstrings
since CONTRIB directory was transformed into a package in NonGNU ELPA.

Reported by Michael Maurer
https://lists.gnu.org/archive/html/emacs-orgmode/2021-07/msg00195.html
2021-09-26 15:45:28 +02:00
Bastien 98fd6d5fd5 Remove references to deleted packages
* testing/lisp/test-ob-vala.el: Delete file.

* mk/default.mk (BTEST_OB_LANGUAGES):
* lisp/ox-man.el (org-man-source-highlight-langs):
* lisp/org.el (org-babel-load-languages): Remove references to
deleted packages.
2021-09-26 14:13:28 +02:00
Sébastien Miquel d74a82448b org.el (org-fontify-extend-region): Fix headline fontification in edge case
* lisp/org.el (org-fontify-extend-region): Fix fontification of
headline or meta line created by inserting a newline.

Unrelated to the fix: `org-fontify-extend-region' is added to
`font-lock-extend-after-change-region-function' and doesn't need to
use `save-excursion'.
2021-09-26 13:23:17 +02:00
TEC df51e934ae
Merge branch 'bugfix' 2021-09-26 19:00:59 +08:00
TEC 6a558fc17b
org: Fix potential modified src match-data issue
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): When this is run on
a src block, a "leaky" major mode called in
`org-src-font-lock-fontify-block' can modify the match data.
This is problematic, as the match data already set is important for
font-lock.  To protect ourselves from this behaviour, we can wrap
`org-src-font-lock-fontify-block' in `save-match-data' to ensure that
the match data for the src block is conserved.
2021-09-26 19:00:47 +08:00
Ihor Radchenko 05ee1e6ee0 Do not rely on M-q binding for filling src-block
* lisp/org.el (org-fill-element): Use `fill-paragraph' instead of
simulating "M-q" binding.
(org-fill-paragraph): Return t as described in `fill-paragraph'
docstring.

Fixes https://orgmode.org/list/CAH7LOt0PO3js6_+Cbinm6EYNx0KFvpfiSS7Dwc1EXsfHfHkHVA@mail.gmail.com/
2021-09-26 09:04:46 +02:00
Ihor Radchenko aea7cab707 Fix duplicate logbook entry for repeated tasks
* lisp/org.el (org-add-log-setup): Always run `org-add-log-note' via
`post-command-hook'.  Otherwise, there is no way to know if a note was
requested for `this-command'.  Running `org-add-log-note' directly
would, for example, break `org-auto-repeat-maybe' as reported in [1].

[1] https://orgmode.org/list/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com
2021-09-26 08:24:58 +02:00
Sébastien Miquel 70e65a2028 org-src.el: Do not indent blank lines, except current one
* lisp/org-src.el (org-src--contents-for-write-back): Do not indent blank lines, except for the
current line maybe.
(org-src--preserve-blank-line): New variable, whether to preserve
indentation of the current blank line.
(org-src--edit-element): Set `org-src--preserve-blank-line'.
* lisp/org.el (org-indent-line): When tab acts natively, do some
preindentation, which signals `org-src--edit-element' to
preserve the indentation of current blank line.

Removing all the whitespace was the original behaviour for all blank lines, before `857ae366b3`.
2021-09-26 07:47:40 +02:00
Bastien faf1ba8cde Merge branch 'bugfix' 2021-09-25 23:09:50 +02:00
Ihor Radchenko 97de19f659 Fix not updating org-clock-marker after refiling from indirect buffer
* lisp/org.el (org-check-and-save-marker): Save markers in base buffer
of indirect buffer in addition to markers in current buffer.

Fixes bug reported in https://orgmode.org/list/CABa5=g4bvYQoTbBn96tFi9K827u_A+MweqYWWpib_tyFLBdG3g@mail.gmail.com/T/#t
2021-09-25 23:09:37 +02:00
Nicholas Vollmer 74a5af619c Fix byte-comp function warnings
* (org.el, org-table.el org-keys.el) Declare functions for byte compiler.
2021-09-25 21:31:25 +02:00
Nicholas Vollmer d8b9bd05ba Fix byte-comp function warnings
* (org.el, org-table.el org-keys.el) Declare functions for byte compiler.
2021-09-25 21:30:32 +02:00
Ihor Radchenko a3c912cb29 Fix duplicate logbook entry for repeated tasks
* lisp/org.el (org-add-log-setup): Always run `org-add-log-note' via
`post-command-hook'.  Otherwise, there is no way to know if a note was
requested for `this-command'.  Running `org-add-log-note' directly
would, for example, break `org-auto-repeat-maybe' as reported in [1].

* lisp/org-agenda.el (org-agenda-todo): Avoid reintroducing the bug
fixed in c670379adf.

* testing/lisp/test-org.el: Add test checking the reported bug.

[1] https://orgmode.org/list/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com
2021-09-25 17:23:53 +02:00
Marco Wahl 4063d4c2d7 org: Rename for more consistency
* lisp/org.el (org-get-previous-sibling): Rename from
  org-get-last-sibling to be more consistent with the rest of Emacs.
  org-get-last-sibling stays as obsolete alias.
2021-09-20 00:27:02 +02:00
Marco Wahl 069bcba529 org: Fix functionality of org-insert-heading
* lisp/org.el (org-insert-heading): Fix insertion of headings when
  point is before any heading in the case of "respect content" insertion.

Kudos to Victor Stoichita. https://orgmode.org/list/87lf4594t3.fsf@svictor.net/
2021-09-18 14:54:09 +02:00
Stefan Kangas 215d80d02b
Fix a small number of typos 2021-09-17 17:01:57 +08:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Marco Wahl a7a69b954c org: Simplify doc
* lisp/org.el (org-end-of-meta-data): Drop unnecessary part around
"regular drawer".

Issue reported by Tom Davey.  https://orgmode.org/list/014801d7aa5c$c9057450$5b105cf0$@tomdavey.com
2021-09-16 10:41:47 +02:00
Kyle Meyer a246a13187 Merge branch 'km/from-emacs-master' 2021-09-12 23:35:16 -04:00
Eli Zaretskii d2deb188a6 Backport commit ff4de1bd8 from Emacs
* lisp/org.el:
* lisp/org-list.el (org-list-to-generic):
* lisp/org-compat.el: In comments, quote 'like this'.

Fix quoting style in Lisp comments
ff4de1bd88b8be4a7071884910ff601eb10fbad5
Eli Zaretskii
Sun Sep 12 19:51:06 2021 +0300
2021-09-12 23:34:08 -04:00
Stefan Kangas 9961abf75a Backport commit fc4b956c7 from Emacs
; Fix symbol quoting typos
fc4b956c7cb2fba8ed2a18865a7686c6cfa5d030
Stefan Kangas
Sun Sep 12 18:36:49 2021 +0200
2021-09-12 23:34:07 -04:00
Nicolas Goaziou 4198cbd074 Strictly match language when loading Elisp code
* lisp/org.el (org-babel-load-file): Strictly check language before
loading source code.

Reported-by: dmg <dmg@turingmachine.org>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00631.html>
2021-08-07 22:22:05 +02:00
Juan Manuel Macias 40a20136d3 Prevent partial fontification when a link is displayed full
* lisp/org.el (org-activate-links): apply `face-property' variable in
other cases when handle invisible parts in bracket
links: `(add-face-text-property start end face-property)' suggestion
from Ihor Radchenko
2021-07-27 22:01:36 +02:00
Nicolas Goaziou c089c234bb Allow `org-edit-special' to open "bibliography" files
* lisp/org.el (org-edit-special): Also edit "bibliography" keywords.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou 524d8fe4c1 Plug citations into fontification process 2021-07-09 08:47:14 +02:00