Commit Graph

21729 Commits

Author SHA1 Message Date
Kyle Meyer 6c4acc8ded org-compat: Define file-attribute accessors
* lisp/org-compat.el (file-attribute-modification-time,
file-attribute-size): New functions for compatibility with Emacsen
before 26.1.

This is a follow-up to the backport of Emacs's 662bee7d7.
2019-01-13 12:43:04 -05:00
Paul Eggert d64c9a996b Backport commit 662bee7d7 from Emacs
* lisp/ob-eval.el (org-babel--shell-command-on-region):
* lisp/org-attach.el (org-attach-commit):
* lisp/org-macro.el (org-macro-initialize-templates):
* lisp/org.el (org-babel-load-file)
(org-file-newer-than-p):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-publish.el (org-publish-find-date)
(org-publish-cache-ctime-of-src):
Prefer (file-attribute-size A) to (nth 7 A), and similarly
for other file attributes accessors.
* lisp/ox-publish.el (org-publish-cache-ctime-of-src):
Prefer float-time to doing time arithmetic by hand.

file-attributes cleanup
662bee7d70ccd3903e123b08c7ec9108a1a2ce0b
Paul Eggert
Sun Sep 23 18:32:59 2018 -0700
2019-01-13 12:43:04 -05:00
Paul Eggert 9a8462771f Backport commit a4a3c92e9 from Emacs
* lisp/org-agenda.el (org-cmp-ts): Avoid arbitrary limit to
most-positive-fixnum or to most-negative-fixnum.
* lisp/org-footnote.el (org-footnote-new): Simplify.
* lisp/org-element.el (org-element--cache-generate-key):
Document fixnum limitation.

Prune most-positive-fixnum from Lisp source
a4a3c92e9de59bd0251f36326375cce898919edc
Paul Eggert
Wed Aug 22 20:46:08 2018 -0700
2019-01-13 12:43:04 -05:00
Paul Eggert 28d2c81709 Backport commit f18af6cd5 from Emacs
* lisp/org.el:
* lisp/ox-publish.el:
Prefer ash to lsh when either will do.

Audit use of lsh and fix glitches
f18af6cd5cb7dbbf7420ec2d3efed4e202c4f0dd
Paul Eggert
Tue Aug 21 13:44:32 2018 -0700
2019-01-13 12:43:04 -05:00
Kyle Meyer da31714c10 org-compat: Define proper-list-p
* lisp/org-compat.el (proper-list-p): New function for compatibility
with Emacsen before 27.1.

This is a follow-up to the backport of Emacs's 2fde6275b.
2019-01-13 12:43:04 -05:00
Basil L. Contovounesios ede0d19feb Backport commit 2fde6275b from Emacs
* lisp/ob-core.el (org-babel-insert-result): Use proper-list-p.

Add predicate proper-list-p
2fde6275b69fd113e78243790bf112bbdd2fe2bf
Basil L. Contovounesios
Mon Jul 9 19:00:43 2018 -0700
2019-01-13 12:43:04 -05:00
Glenn Morris f73cc4811b Backport commit 18de2ada2 from Emacs
* lisp/org.el (org-CUA-compatible)
(org-popup-calendar-for-date-prompt):
Move aliases before targets, to silence new compiler warning.

More alias-related tedium
18de2ada243653ece98b18044233e5d29eee5903
Glenn Morris
Fri Apr 20 18:55:04 2018 -0400
2019-01-13 12:43:04 -05:00
Glenn Morris 3d11e4c69b Backport commit 9c3eeba4d from Emacs
* lisp/org-agenda.el (org-agenda-search-view-search-words-only)
(org-agenda-remove-tags-when-in-prefix)
(org-agenda-align-tags-to-column, org-agenda-keymap):
* lisp/org.el (org-special-ctrl-a)
(org-log-state-notes-into-drawer)
(org-agenda-multi-occur-extra-files):
Move aliases before targets, to silence new compiler warning.

The tedious game of whack-a-mole with compiler warnings continues
9c3eeba4db26ddaeead100beea7a96f9fa640918
Glenn Morris
Fri Apr 20 18:34:39 2018 -0400
2019-01-13 12:43:04 -05:00
Paul Eggert 32dbbfa26c Backport commit 20b858ef1 from Emacs
Prefer \... to control chars in .el literals
20b858ef13f8f71fae6cbce5cdac31c4dd130600
Paul Eggert
Thu Mar 29 17:43:08 2018 -0700
2019-01-13 12:43:04 -05:00
Glenn Morris d5a7a1a22c Backport commit 1c7db8aa3 from Emacs
* lisp/org-ctags.el:
* lisp/org-macs.el: Explicitly require cl-lib as needed.

Explicitly require cl-lib where needed
1c7db8aa30969d0bc0e6d35b9bd57c70314ed9d0
Glenn Morris
Fri Mar 16 20:41:17 2018 -0400
2019-01-13 12:43:04 -05:00
Glenn Morris 6a5082fccf Backport commit b1d7e5852 from Emacs
* lisp/org-agenda.el (org-agenda-mode):
* lisp/org-indent.el (org-indent-mode):
Replace filter-buffer-substring-functions, obsolete since 24.4.

Replace some obsolete uses of filter-buffer-substring-functions
b1d7e58520dc42a4eda902aa934a250fda6a04ca
Glenn Morris
Thu Mar 15 20:23:09 2018 -0400
2019-01-13 12:43:04 -05:00
Glenn Morris 16c8187db1 Backport commit d5f6ff99c from Emacs
* lisp/org.el (image-refresh):
* lisp/ox-odt.el (clear-image-cache, image-size): Declare.

Quieten without-x org compilation
d5f6ff99c2b594919931b277a2d94d3a289ca764
Glenn Morris
Wed Feb 28 16:55:41 2018 -0500
2019-01-13 12:43:04 -05:00
Radon Rosborough 31a861e0d3 Backport commit 24acb31c0 from Emacs
* doc/org-manual.org: Don't recommend to call package-initialize in
the init file.

Add early init file, stop package-initialize insertion
24acb31c04b4048b85311d794e600ecd7ce60d3b
Radon Rosborough
Sat Feb 17 13:36:16 2018 +0200
2019-01-13 12:43:04 -05:00
Kyle Meyer 6df3e8880e Partially revert backport of c75f505de
* lisp/org-colview.el (org-columns-compute-all):
* lisp/org-timer.el (org-timer-start):
(org-timer-pause-or-continue):
(org-timer-seconds):
(org-timer-set-timer):
* lisp/org.el (org-read-date-analyze): Restore use of `current-time`
for testing purposes.

In these spots, we call (current-time) so that it can be overriden in
tests.  Add a comment about this in the cases that don't have one.
2019-01-13 12:43:04 -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
Paul Eggert eb10ad9360 Backport commit c75f505de from Emacs
* lisp/org-agenda.el (org-agenda-to-appt):
* lisp/org-clock.el (org-clock-resolve-clock)
(org-clock-resolve, org-resolve-clocks-if-idle):
* lisp/org-colview.el (org-columns-edit-value, org-columns)
(org-agenda-columns):
* lisp/org-element.el (org-element--cache-interrupt-p)
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-get-faces)
(org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el ((org-timer-show-remaining-time):
* lisp/org.el (org-babel-load-file, org-current-time)
(org-today, org-auto-repeat-maybe)
(org-small-year-to-year, org-goto-calendar):
* lisp/ox.el (org-export-insert-default-template):
Use nil instead of (current-time) where either will do, as nil is
a bit more efficient and should have less timing error.

Prefer nil to (current-time) when either works
c75f505dea6a560b825384cf3d277690f86840bf
Paul Eggert
Fri Oct 20 19:42:23 2017 -0700

Note(km): The changes that will reverted in the next commit have been
dropped from the ChangeLog entries above.
2019-01-13 12:43:03 -05:00
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 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
Nicolas Goaziou 19babce53f org-manual: Fix markup
* doc/org-manual.org (Field and range formulas): Use =...= markup for
  text meant to be inserted in an Org document.
2018-12-29 15:50:43 +01:00
Nicolas Goaziou be9bfd3ff4 org-manual: Small fixes
* doc/org-manual.org (Completion): Use @kbd markup in description.
(Context Dependent Documentation): Improve description and wording.
Add kindex entry.
2018-12-27 11:20:27 +01:00
Bastien 71582aef6e Merge branch 'maint' 2018-12-26 16:08:13 +01:00
Bastien 495c7c6a57 Merge branch 'master' of code.orgmode.org:bzg/org-mode 2018-12-21 09:52:49 +01:00
Nicolas Goaziou 908b55124c org-manual: Fix markup
* doc/org-manual.org (Initial visibility): Fix markup.
2018-12-20 18:36:01 +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
Bastien 67ee27cec2 Merge branch 'master' of code.orgmode.org:bzg/org-mode 2018-12-19 10:22:36 +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 cd0517da24 org-manual: Fix markup
* doc/org-manual.org (Handling Links):
(Using capture):
(Capture templates):
(Refile and Copy):
(Footnotes): Fix markup.
2018-12-18 01:17:15 +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 c024844e56 org-capture: Fix failing tests
* testing/lisp/test-org-capture.el (test-org-capture/abort):
(test-org-capture/item):
(test-org-capture/table-line):
(test-org-capture/plain): Fix failing tests.
2018-12-17 17:43:23 +01:00
Bastien a311f29db1 Merge branch 'master' of code.orgmode.org:bzg/org-mode 2018-12-17 09:49:26 +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
Bastien f89189c618 Merge branch 'master' of code.orgmode.org:bzg/org-mode 2018-12-15 17:16:47 +01:00
Nicolas Goaziou dc74770706 org-manual: Fix typos
* doc/org-manual.org (Using Emacs packaging system):
(Formula syntax for Calc):
(Lookup functions):
(Weekly/daily agenda):
(Setting limits for the agenda):
(Export Settings):
(Other Built-in Back-ends):
(Structure Templates):
(Adding Hyperlink Types): Use correct markup for sexps.
(Using the Mapping API): Fix typo.  Use correct markup.
2018-12-14 14:37:01 +01:00