Commit Graph

14871 Commits

Author SHA1 Message Date
Paul Eggert d4a295e46a Backport commit 2fcf2dff0 from Emacs
Fix copyright years by hand
2fcf2dff00a55ece17f4342a934cb1d69ae1a743
Paul Eggert
Tue Jan 1 01:02:40 2019 +0000
2019-01-13 12:43:03 -05:00
Kyle Meyer c11b147d1d org-parse-time-string: Describe time stamp matching behavior
* lisp/org-macs.el (org-parse-time-string): Document matching of
YYYY-MM-DD substring.

org-clock-special-range used to pass in <-50001-11-30 Tue 00:00> with
the expectation that the year would be parsed as -50001, not 0001.
Mention this YYYY-MM-DD format assumption in the docstring to help
avoid such cases.
2019-01-13 12:43:03 -05:00
Kyle Meyer 9ceb723602 org-clock: Simplify `untilnow' range logic
* lisp/org-clock.el (org-clock-special-range): Use nil to represent
`untilnow'.
* lisp/org-clock.el (org-clocktable-steps): For `untilnow' block, set
set timestamp to 2003.
* doc/org-manual.org (The clock table): Document `untilnow' floor when
used with :step.

For `untilnow', org-clock-special-range sets the start to
"<-50001-11-30 Tue 00:00>", but org-parse-time-string actually assumes
a YYYY-MM-DD format and parses the year as 0001.  By chance, this is
still a really old date, so no one noticed.  However, with the port of
Emacs's fde99c729c (Port recent org-clock fix to POSIX time_t,
2018-03-28), test-org-clock/clocktable/ranges would fail if the system
supports the oldest date tried, "<-67715-09-22 Tue 17:51>".

But this "encode-time -> format-time-string -> org-parse-time-string"
dance is mostly unnecessary.  All the current org-clock-special-range
callers except for org-clocktable-steps (1) explicitly check if the
starting time is nil, (2) don't use the starting time, or (3) pass it
directly to org-clock-sum, which handles nil values.  And
org-clock-sum executes the same codepath when nil is passed instead of
"really old date".

Update org-clocktable-steps to use 2003 (the year Org was created) as
the starting point when org-clock-special-range returns nil for the
starting time.  This is more efficient because we don't needlessly
calculate steps over a large chunk of time that almost certainly
doesn't have any clocked time.  And it won't run into the portability
issues like Emacs's fde99c729c.  2003 _should_ be an appropriate
effective starting date, since we don't expect clocked time before the
existence of Org.  If this turns out to be an issue (e.g., someone
converted reports from a pre-Org and still makes clock tables that
include those times), we can make this value configurable.
2019-01-13 12:41:29 -05:00
Marco Wahl 295d149f46 agenda: Fix get category for habit lines
* lisp/org-agenda.el (org-agenda-get-category): New function to wrap
  the identification of the category of an agenda line.
2019-01-13 15:09:04 +01:00
Kyle Meyer f3584ecc3b org-clock: Correctly locate heading when resolving clock
* lisp/org-clock.el (org-clock-resolve-clock): Store heading location
as marker instead of raw position to ensure that org-clock-in is
called in the correct buffer.

This fixes a regression introduced by 503ede74b (org-clock: Fix
resolving clocks, 2018-12-06).
2019-01-13 00:13:33 -05:00
Kyle Meyer 87c4635c88 Fix docstring typo
* lisp/org.el (org-insert-link): Fix docstring typo.
2019-01-12 23:47:36 -05:00
Nicolas Goaziou f9596eb472 Fix following timestamp in planning lines
* lisp/org.el (org-open-at-point): Open calendar when called on
  a timestamp in a planning line.

Reported-by: Bob Hepple <bob.hepple@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00158.html>
2019-01-12 11:49:50 +01:00
Nicolas Goaziou ae497f365e org-table: Also copy special star marker upon creating a row
* lisp/org-table.el (org-table-insert-row): Copy "*" character when in
  first column, as it is considered as a special marker then.
2019-01-12 11:36:40 +01:00
Kaushal Modi 34e5dcfb06 Fix the order of org-get-tags collected tags from #+filetags
* lisp/org.el (org-get-tags): Now org-get-tags returns tags list with
  tags from #+filetags in the beginning.

* testing/lisp/test-org.el (test-org/get-tags): Add test.

Fixes regression caused by commit
<5e27b2fd32>.

Bug reported in
<https://lists.gnu.org/r/emacs-orgmode/2019-01/msg00052.html>.
2019-01-08 11:29:58 -05:00
Marco Wahl e8ad394c74 org: Fix docstring
* lisp/org.el (org-loop-over-headlines-in-active-region): Complete the
  list of concerned functions.
2019-01-05 11:35:26 +01:00
Kaushal Modi 539091799b Fix C-u M-x org-align-tags not aligning all tags in buffer
* lisp/org.el (org-align-tags): Move point to the beginning of the
  visible buffer first before attempting to look for Org headline
  tags.

* testing/lisp/test-org.el (test-org/tag-align): Add test.

Fixes a regression in
1615261cdc.

Bug reported in
<https://lists.gnu.org/r/emacs-orgmode/2019-01/msg00051.html>.
2019-01-04 08:57:10 -05:00
Van L 98407c111d Fix two docstring typos
* lisp/org.el (org-read-date-force-compatible-dates): Fix docstring
typos.

TINYCHANGE
2019-01-03 20:43:01 -05:00
Nicolas Goaziou 284799a2e8 Fix `org-insert-link' with nil description
* lisp/org.el (org-insert-link): DESC may be nil; do not use
  `string-match' directly on it.
2019-01-01 17:16:50 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Renato Ferreira 255c9c1655 org-protocol: Fix `org-protocol-capture' return value
* lisp/org-protocol.el: Make sure protocols with :kill-client do
not return a string.

TINYCHANGE
2018-12-19 16:23:59 +01:00
Nicolas Goaziou 2d9b08b897 org-colview: Remove asterisks from ITEM in Agenda mode
* lisp/org-colview.el (org-columns--displayed-value): Add new optional
  argument.
(org-columns--collect-values): Use new argument when called from
Agenda mode.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-12/msg00040.html>
2018-12-18 12:07:43 +01:00
Nicolas Goaziou 4f0d8a008f org-colview: Improve docstring
* lisp/org-colview.el (org-dblock-write:columnview): Improve docstring.
2018-12-18 11:08:48 +01:00
Nicolas Goaziou 13f299fe8b org-colview: Fix docstrings
* lisp/org-colview.el (org-columns--overlay-text):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix docstrings.
2018-12-18 09:54:24 +01:00
Nicolas Goaziou 5949d9352b org-capture: Tiny refactoring
* lisp/org-capture.el (org-capture): Use `when' instead of one-armed
  `if'.  Use `error-message-string' when possible.
2018-12-18 09:40:58 +01:00
Nicolas Goaziou fbd1deca57 org-protocol: Fix capture protocol without a URL
* lisp/org-protocol.el (org-protocol-capture): Do not corrupt
  `org-stored-links' when there is no URL to capture.
(org-protocol-do-capture): Remove function.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-12/msg00131.html>
2018-12-18 09:30:32 +01:00
Nicolas Goaziou abbe5d3958 Fix a docstring
* lisp/org.el (org-store-link-functions): Fix docstring.
2018-12-18 01:07:21 +01:00
Nicolas Goaziou 0811af50b4 ox-latex: Improve subscript and superscript
* lisp/ox-latex.el (org-latex--wrap-latex-math-block): Ignore
  superscript and subscript.
(org-latex--script-size): Remove function.
(org-latex-subscript): Use \textsubscript.
(org-latex-superscript): Use \textsuperscript.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-12/msg00221.html>
2018-12-18 00:42:07 +01:00
Nicolas Goaziou 6656f11596 Fix typo
* lisp/org.el (org-do-latex-and-related): Fix typo.
2018-12-16 11:13:49 +01:00
Nicolas Goaziou af3e2b1856 Fix fontification of LaTeX elements (take two)
* lisp/org.el (org-do-latex-and-related): Fix last commit.
2018-12-16 11:08:00 +01:00
Nicolas Goaziou a86b14253b Fix fontification of LaTeX environments
* lisp/org.el (org-compute-latex-and-related-regexp):
(org-do-latex-and-related): Fix fontification of LaTeX environments.
2018-12-13 21:28:14 +01:00
Kaushal Modi a60a0edc6f Add :no-save keyword for Org capture templates
* lisp/org-capture.el (org-capture-finalize): Do not save the target
  capture file if :no-save keyword is non-nil in the capture template.
* doc/org-manual.org (Template elements),
  lisp/org-capture.el (org-capture-templates): Document :no-save.

Ref: https://lists.gnu.org/r/emacs-orgmode/2018-09/msg00325.html
2018-12-13 14:09:39 -05:00
Kaushal Modi 54123cd7f2 Revert "org-capture: Do not save buffer when running `org-capture-finalize'"
This reverts commit b4422add37.

Revert the regression in Org capture + auto-saving behavior.

Ref: https://lists.gnu.org/r/emacs-orgmode/2018-09/msg00325.html
2018-12-13 10:11:25 -05:00
Allen Li 601f373e3f Document %i prefix in capture templates
* doc/org-manual.org (Template expansion): Fix documentation.
* lisp/org-capture.el (org-capture-templates): Fix docstring.
2018-12-09 23:34:20 +01:00
Jens Lechtenboerger 3b5e26651b ox-html: Export attributes specified with :attr_html for links
* lisp/ox-html.el (org-html-link): Export :attr_html from link.
2018-12-08 21:20:18 +01:00
Nicolas Goaziou e9108043e1 org-capture: Fix %i with prefix containing "\\"
* lisp/org-capture.el (org-capture-fill-template): Fix %i with prefix
  containing "\\".
* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Add test.
2018-12-08 11:49:10 +01:00
Nicolas Goaziou 1d60d5ee03 org-capture: Correctly store position of captured entry
* lisp/org-capture.el (org-capture-place-entry): Store position at the
  beginning of the capture entry, not at its end.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): Add test.
2018-12-06 15:07:03 +01:00
Nicolas Goaziou 503ede74bc org-clock: Fix resolving clocks
* lisp/org-clock.el (org-clock-resolve-clock): Fix resolving clocks
  when the entry is empty barring the clock itself and possibly the
  clock drawer, and `org-clock-out-remove-zero-time-clocks' is
  non-nil.
2018-12-06 00:24:14 +01:00
Nicolas Goaziou 04641c4bbe org-pcomplete: Silence byte-compiler 2018-11-30 21:20:39 +01:00
Nicolas Goaziou d3f9cd0eef ox-latex: Use "french" instead of "frenchb" Babel language
* lisp/ox-latex.el (org-latex-babel-language-alist): Use "french"
  instead of obsolete "frenchb".
2018-11-28 15:12:56 +01:00
Nicolas Goaziou e3fdef74b9 Improve docstrings
* lisp/org.el (org-latex-default-packages-alist):
(org-latex-packages-alist): Improve docstring.
* lisp/ox-latex.el (org-latex--remove-packages): Small refactoring.
2018-11-28 00:26:24 +01:00
Nicolas Goaziou 3216cbe776 ox: Preserve properties when duplicating buffer before exporting
* lisp/ox.el (org-export--generate-copy-script): Preserve properties
  when duplicating buffer before exporting.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00329.html>
2018-11-27 23:42:16 +01:00
Nicolas Goaziou b16feed40c Normalize blank lines with <C-RET>
* lisp/org.el (org-insert-heading): Make C-RET more predictable.  In
  particular, it should not eat all the blank lines at the end of the
  tree.

Reported-by: David Masterson <dsmasterson@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00275.html>
2018-11-27 23:21:06 +01:00
Nicolas Goaziou d6e20dbcff ox-latex: Gracefully handle export of source blocks without lang
* lisp/ox-latex.el (org-latex-src-block): Handle export of source
  blocks without language.

Reported-by: John Ciolfi <ciolfi@mathworks.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00321.html>
2018-11-27 21:46:18 +01:00
Nicolas Goaziou cd60a35fe1 Fix opening custom ID links with percent escaped syntax
* lisp/org.el (org-open-at-point): Un-escape percent escaped path.
* testing/lisp/test-org.el (test-org/custom-id): Add test.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00303.html>
2018-11-26 23:56:17 +01:00
Nicolas Goaziou 32a7305dda Fix <RET> on table.el tables
* lisp/org.el (org-return): Prevent wrong type error when on
  a table.el table.
2018-11-26 19:51:51 +01:00
Nicolas Goaziou d228909d15 org-element: Be more strict when looking for table.el tables
* lisp/org-element.el (org-element--current-element): Increase number
  of checks to avoid more false positive.

In particular "+-+" is not recognized anymore as a table.el table.
2018-11-26 19:50:08 +01:00
Nicolas Goaziou 8b7ba29b60 org-pcomplete: Fix tag completion
* lisp/org-pcomplete.el (org-thing-at-point): Only complete where tags
  could be located.
(pcomplete/org-mode/tag): Add paring argument to avoid looking at
other arguments on the same line.
* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/tag): New test.

Reported-by: Alain.Cochard@unistra.fr
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00154.html>
2018-11-25 02:01:41 +01:00
Nicolas Goaziou fc9cf62bf3 org-clock: Fix special strings in :tstart and :tend
* lisp/org-clock.el (org-clocktable-steps): Handle relative time
  strings like "<-1w>".
2018-11-17 21:45:16 +01:00
Nicolas Goaziou 7bf3c10819 Fix speed regression introduced in change about repeated timestamps
* lisp/org.el (org-auto-repeat-maybe): Fix speed regression introduced
  in "Also obey to repeaters in inactive time stamps".

Reported-by: Marco Wahl <marcowahlsoft@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00078.html>
2018-11-17 16:33:04 +01:00
Marco Wahl feb44212b5 org-agenda: slightly changed hints for user about searching again 2018-11-12 12:47:40 +01:00
Nicolas Goaziou afcb1d3899 Fix typo
* lisp/org.el (org-get-tags): Fix typo in docstring.
2018-11-11 22:24:00 +01:00
Nicolas Goaziou 5dfbe46b1e ox-odt: Fix typo
* lisp/ox-odt.el (org-odt-template): Fix typo.
2018-11-10 21:59:52 +01:00
Nicolas Goaziou 9056d2b706 ox-odt: Fix last commit
* lisp/ox-odt.el (org-odt-template): Add missing `org-strip-quote'
  call.
2018-11-10 21:56:10 +01:00
Nicolas Goaziou bea916d9f6 ox-odt: Improve styles file handling
* lisp/ox-odt.el (org-odt-template): Allow double quotes around file
  name.  Better error handling.  Small refactoring.
2018-11-10 20:00:02 +01:00
Nicolas Goaziou af81211fdc Also obey to repeaters in inactive time stamps
* lisp/org.el (org-repeat-re): Accept inactive time stamps.
(org-auto-repeat-maybe): Small refactoring.  Find additional repeaters
also in inactive time stamps.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add test.

Reported-by: Leo Gaspard <orgmode@leo.gaspard.io>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00078.html>
2018-11-10 19:59:48 +01:00