Commit graph

13082 commits

Author SHA1 Message Date
Nicolas Goaziou 53bc58c433 Rename org-latex--make-preamble' into org-latex-make-preamble'
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template):
* lisp/org.el (org-create-formula-image):
* lisp/ox-beamer.el (org-beamer-template):
* lisp/ox-latex.el (org-latex-make-preamble): Renamed from
  `org-latex--make-preamble'.  Add an optional argument.  Autoload
  function.
(org-latex-template): Use new function name.
2017-01-21 11:31:25 +01:00
Nicolas Goaziou bbdecd1e64 org-element: Disable cache by default
* lisp/org-element.el (org-element-use-cache): Set default value to
  nil.

Using cache introduces Emacs' freezes under not well known
circumstances.  Until this is sorted out, this variable should be nil,
at least on "maint" branch.
2017-01-21 10:40:39 +01:00
Nicolas Goaziou 35e90ced24 ox-latex: Fix insertion of line breaks at invalid locations
* lisp/ox-latex.el (org-latex-clean-invalid-line-breaks): New function.

Reported-by: Takeshi Teshima <takeshi.diadochos@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111313>
2017-01-18 23:30:01 +01:00
Kyle Meyer 1fbc7a424f org-clone-subtree-with-time-shift: Fix SHIFT check
* lisp/org.el (org-clone-subtree-with-time-shift): Don't choke on a
  blank SHIFT argument.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
  test.

This fixes a regression introduced by c31462f33.
2017-01-17 21:16:24 -05:00
Nicolas Goaziou d2af251077 org-colview: Fix summary computation in agenda
* lisp/org-colview.el (org-agenda-colview-summarize): Do not include
  already summarized values in current summary.
2017-01-17 12:00:49 +01:00
Nicolas Goaziou b223c099f0 org-colview: Fix missing agenda summary if org-agenda-overriding-header is set
* lisp/org-colview.el (org-agenda-colview-summarize): Do not ignore
  first agenda line when displaying summaries.

This fixes a regression introduced in
279902ca4d.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/111473>
2017-01-17 11:35:05 +01:00
Nicolas Goaziou 181dc50d11 Small fix
* lisp/org.el (org-clone-subtree-with-time-shift): Handle nil shift
  case.
2017-01-17 09:59:53 +01:00
Nicolas Goaziou c31462f33e Fix `org-clone-subtree-with-time-shift'
* lisp/org.el (org-clone-subtree-with-time-shift): Fix commit
  8fc9ab83b. Small refactoring.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
  tests.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111477>
2017-01-17 09:49:48 +01:00
Kyle Meyer 8fc9ab83b4 org-clone-subtree-with-time-shift: Fix timestamp search
* lisp/org.el (org-clone-subtree-with-time-shift): Move to the
  beginning of the heading before the timestamp search so that the
  user will be prompted for a time shift even if point is after the
  timestamp.

This also prevents an "Invalid search bound" error if point is on the
blank line following a body-less heading:

   * single line <2017-02-28 Wed>
    <point here>

Reported-by: Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/111456>
2017-01-16 22:24:25 +01:00
Kyle Meyer f277d95c3b ox-publish: Fix docstring typo
* lisp/ox-publish.el (org-publish-property): Fix docstring typo.
2017-01-15 16:41:22 -05:00
Nicolas Goaziou f0c08e3cbb Fix `org-drag-element-backward' with point just below a headline
* lisp/org.el (org-drag-element-backward): When point is on empty
  lines below a headline, call `org-move-subtree-up'.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
2017-01-14 23:23:26 +01:00
Nicolas Goaziou 1f76dd1fe1 org-mobile: Silence byte-compiler 2017-01-14 16:16:08 +01:00
Nicolas Goaziou bed17f1bb5 org-mobile: Fix `org-mobile-push' with stick agendas
* lisp/org-mobile.el (org-mobile-push): Do not move back to non-sticky
  agendas once called.

Reported-by: Ian Dunn <dunni@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/111334>
2017-01-14 16:12:43 +01:00
Nicolas Goaziou 1749dfe091 ox-odt: Fix verse environment
* lisp/ox-odt.el (org-odt--encode-tabs-and-spaces): Small refactoring.
(org-odt-verse-block): Only replace leading blanks.
2017-01-12 15:27:39 +01:00
Nicolas Goaziou 0e626313e1 ox-html: Fix verse environment
* lisp/ox-html.el (org-html-verse-block): Do not insert duplicates
  "br" close-tags.  Refactor code.
2017-01-12 14:47:32 +01:00
Nicolas Goaziou 5ada73aef6 org-element: Fix `org-element-normalize-contents'
* lisp/org-element.el (org-element-normalize-contents): Fix return
  value when any line after the first has no indentation.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
  Add test.
2017-01-12 14:33:17 +01:00
Nicolas Goaziou 1d57c5670a ox-html: Fix docstrings style
* lisp/ox-html.el (org-html-close-tag):
(org-html-doctype):
(org-html--make-attribute-string): Fix docstring style.
2017-01-12 09:58:50 +01:00
Nicolas Goaziou ee181b3250 ox-html: Remove spurious white space when closing a tag
* lisp/ox-html.el (org-html-close-tag): Remove spurious white space
  when no attribute is given.  Add a docstring.
2017-01-12 09:54:22 +01:00
Nicolas Goaziou 909a04e011 ox: Fix "user-error: Unable to resolve link nil" message
* lisp/ox.el (org-export-resolve-fuzzy-link): Fix typo preventing to
report the proper path of the broken link.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/111357>
2017-01-11 21:00:37 +01:00
Nicolas Goaziou 34f86ce6a4 ox-latex: Silence byte-compiler
* lisp/ox-latex.el (org-latex-format-headline-default-function):
(org-latex-format-inlinetask-default-function): Silence byte-compiler.
2017-01-11 12:36:49 +01:00
Nicolas Goaziou 3fa7903d76 ox-latex: Properly escape special characters in tags
* lisp/ox-latex.el (org-latex-format-headline-default-function):
(org-latex-format-inlinetask-default-function): Use
`org-latex--protect-text' instead of `org-latex-plain-text' to format
tags.
2017-01-11 12:20:05 +01:00
Nicolas Goaziou 71890398cd org-capture: Fix :jump-+to-captured when `org-capture-bookmark' is nil
* lisp/org-capture.el (org-capture-bookmark-last-stored-position):
  Rename to ...
(org-capture-store-last-position): ... this.  Also store last position
unconditionally.
* lisp/org-capture.el (org-capture-finalize): Apply renaming.
2017-01-11 09:52:57 +01:00
Nicolas Goaziou 6a49de8862 org-capture: Improve error message for date/weektree capture
* lisp/org-capture.el (org-capture-set-target-location): Raise an
  error when target location is not an Org buffer.

Reported-by: Simao <smm@imap.cc>
<http://permalink.gmane.org/gmane.emacs.orgmode/111320>
2017-01-11 09:17:18 +01:00
Nicolas Goaziou a0409e56c3 ox: Fix comments removal during export
* lisp/ox.el (org-export--skip-p): Handle comments and comment blocks
  removal.
(org-export--delete-comments): Rename to...
(org-export--delete-comment-trees): ... this.  Now only take care of
commented trees and inlinetasks.

* testing/lisp/test-ox.el (test-org-export/comments): Add test.
(org-test-with-parsed-data): Apply renaming.
2017-01-11 00:23:53 +01:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Stefan Monnier 029c2deccc Backport commit 2ec41c415 from Emacs
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Avoid add-to-list on local variables.

Avoid add-to-list on local variables
2ec41c415f39990561cc9da4c9bad0b69bfad489
Stefan Monnier
Wed Jan 4 00:40:45 2017 -0500
2017-01-05 20:19:36 -05:00
Nicolas Goaziou 8318957da5 org-agenda: Fix effort filtering for entries with tags
* lisp/org-agenda.el (org-agenda-compare-effort): Fix retrieval of
  `effort-minutes' property from entries with tags.

Reported-by: wtm <wtmonroe.ls@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111194>
2017-01-04 23:28:58 +01:00
Nicolas Goaziou 7419075e48 org-agenda: Fix UI bug with effort filter
* lisp/org-agenda.el (org-agenda-filter-by-effort): "0" key
  effectively selects the last effort duration instead of the first
  one.  Do not accept invalid keys, i.e., do not treat most of invalid
  keys as "0".
2017-01-04 23:09:00 +01:00
Nicolas Goaziou 3bba31ff44 Fix "invalid face reference" when filtering agenda by effort
* lisp/org-faces.el (org-agenda-filter-effort): New face.
(org-agenda-filter-category): Fix docstring.

Reported-by: wtm <wtmonroe.ls@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111132>
2017-01-03 22:11:11 +01:00
Nicolas Goaziou 93f90c8412 ob-shell: Fix wrong variable assignment binding
* lisp/ob-shell.el (org-babel-shell-initialize): Provide bindings to
  handle variable assignments for all the supported shells.
(org-babel--variable-assignments:sh-generic):
(org-babel--variable-assignments:bash_array):
(org-babel--variable-assignments:bash_assoc):
(org-babel--variable-assignments:bash): Rename using an internal
naming scheme since they are not meant to be called directly from
"ob-core.el".
(org-babel-variable-assignments:shell): Apply renaming.

Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111139>
2017-01-03 18:28:50 +01:00
Nicolas Goaziou d90ca0d7c9 ob-ruby: Silence byte-compiler 2017-01-02 00:14:06 +01:00
Rick Frankel 14e3209731 Update ob-ruby for inf-ruby 2.5
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): `run-ruby` has
   very different semantics in inf-ruby 2.5. Set ruby command to the
   default which used to be set by `run-ruby` and try and find already
   existing buffer before invocation.
2017-01-01 19:55:56 +01:00
Nicolas Goaziou 336bab6ea7 Update copyright years
* lisp/org-crypt.el:
* lisp/ox-publish.el: Update copyright years.
2017-01-01 11:19:15 +01:00
Nicolas Goaziou c7cc30b4d6 ox-publish: Back-port `org-publish-property'
* lisp/ox-publish.el (org-publish-property): New function.
2017-01-01 10:43:48 +01:00
Nicolas Goaziou dd727cf0cb org-crypt: Fix data loss when providing an empty key
* lisp/org-crypt.el (org-encrypt-entry): Insert original text back
  upon encryption failure.

Reported-by: fxiny <wtimew@libero.it>
<http://permalink.gmane.org/gmane.emacs.orgmode/111115>
2017-01-01 10:34:36 +01:00
Nicolas Goaziou dff9cf9c80 ox-publish: Fix `org-publish-get-project-from-filename' and :include
* lisp/ox-publish.el (org-publish-get-project-from-filename): Properly
  check included files.  Complete docstring.  Refactor code.
2016-12-31 12:28:02 +01:00
Nicolas Goaziou acebe9a282 ox-publish: Fix :base-extension set to `any'
* lisp/ox-publish.el (org-publish-get-project-from-filename): Handle
  case when :base-extension is `any'.
(org-publish-project-alist): Improve docstring.

Reported-by: Arun Isaac <arunisaac@systemreboot.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111085>
2016-12-29 21:16:13 +01:00
Alexey Lebedeff 3e68d01bdd Reveal tags after setting them
* lisp/org.el (org-set-tags): Reveal newly inserted tags.
* testing/lisp/test-org.el (test-org/set-tags): New test.

Sometimes freshly added tags can be sucked into invisible outline
region (denoted by ellipsis) - and to see them you need to do the full
global visibilty cycle.
2016-12-29 16:38:38 +01:00
Nicolas Goaziou 57ca9ba80a org-clock: Fix ":formula %" with disparate duration formats
* lisp/org-clock.el (org-clock-time%): Handle various duration
  formats.  Refactor code.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Add
  tests.

Reported-by: Andreas Mueller <lists@0x7.ch>
<http://permalink.gmane.org/gmane.emacs.orgmode/111067>
2016-12-29 01:19:00 +01:00
Nicolas Goaziou bbbed7aad9 ox-publish: Fix typos 2016-12-27 08:30:01 +01:00
Nicolas Goaziou 4cf56e6e89 Fix following links starting with square brackets
* lisp/org.el (org-link-search): Improve regexp.
* testing/lisp/test-org.el (test-org/fuzzy-links): Add tests.
2016-12-26 10:32:26 +01:00
Nicolas Goaziou 820d1eb617 Fix `org-compile-file'
* lisp/org.el (org-compile-file): Ensure `out-dir' is always a string.
2016-12-22 13:12:19 +01:00
Matt Lundin 13751c3249 Fix org-clock-load
Since commit fda64f1ae2 on November 6,
org-clock-load no longer restores clocks in org-clock-persist-file. The
contents of the file look like this:

(setq org-clock-stored-history '(("/home/matt/org/inbox.org" . 39479) ("/home/matt/org/reading.org" . 63478)))

The files both exist; the position information is correct; and
org-clock-persist is t. And yet after calling org-clock-load,
org-clock-history, org-clock-loaded, and org-clock-stored-history remain
nil.

The problem, it seems, is that the logic/order of the if statement was
reversed in the commit above. The attached patch should fix the issue.

Best,
Matt

[4. text/x-diff; 0001-org-clock-Fix-org-clock-load.patch]
From 6d649016fbbfaa28c902ee1e71c20ecf332f8a14 Mon Sep 17 00:00:00 2001
From: Matt Lundin <mdl@imapmail.org>
Date: Mon, 19 Dec 2016 17:24:10 -0600
Subject: [PATCH] org-clock: Fix org-clock-load

* lisp/org-clock.el: (org-clock-load): Fix incorrect order in if
statement that was preventing org-load from loading stored data and
populating org-clock-history.
2016-12-20 18:01:02 +01:00
Nicolas Goaziou 1d7f1349c9 org-list: Clarify code
* lisp/org-list.el (org-list-item-body-column): Clarify code.
2016-12-19 12:06:30 +01:00
Nicolas Goaziou 51efd7f1db org-list: Fix "Stack overflow in regexp matcher"
* lisp/org-list.el (org-list-item-body-column): Do not backtrack as
  much in regexp.

Reported-by: Vasilij Schneidermann <v.schneidermann@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110885>
2016-12-16 22:41:08 +01:00
Nicolas Goaziou a1f516f8a5 org-agenda: Fix "Wrong type argument: number-or-marker-p"
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): Make sure deadline and schedule are
a number and not a string.

Reported-by: Jeffrey DeLeo <JeffreyDeLeo@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110837>
2016-12-15 22:16:19 +01:00
Nicolas Goaziou 3e60cb900d ox-ascii: Fix internal and ID links
* lisp/ox-ascii.el (org-ascii--describe-datum): New function.
(org-ascii--describe-links): Use new function.  Do not ignore fuzzy
links anymore when they contain a description.
(org-ascii-link): Use new function.  Better handling of internal
links.
* lisp/ox.el (org-export-dictionary): New entries: "See figure %s",
  "See listing %s", "See table %s".

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110788>
2016-12-15 16:12:58 +01:00
Nicolas Goaziou 51227cff94 Fix C-c C-c on inline tasks
* lisp/org.el (org-ctrl-c-ctrl-c): Properly recognize inlinetasks as
  a valid context.
2016-12-15 14:24:01 +01:00
Nicolas Goaziou 7856018d78 org-macs: Tiny refactoring
* lisp/org-macs.el (org-match-line): Use (beginning-of-line) instead
  of (goto-char (point-at-bol)).
2016-12-15 00:02:58 +01:00
Nicolas Goaziou 22a4896bf8 org-info: Fix docstrings
* lisp/org-info.el (org-info-other-documents):
(org-info-map-html-url): Fix docstrings.

Suggested-by: Chunyang Xu <mail@xuchunyang.me>
2016-12-14 21:37:03 +01:00
Nicolas Goaziou b5cebbc412 ox-beamer: Fix target export
* lisp/ox-beamer.el (beamer): Let "latex" export-back-end handle
  targets.
2016-12-14 13:15:48 +01:00
Nicolas Goaziou 1c95729788 ox: Fix internal references when using `org-export-(data-)with-backend'
* lisp/ox.el (org-export-data-with-backend):
(org-export-with-backend): Preserve internal references once the local
back-end has been applied.

* testing/lisp/test-ox.el (test-org-export/get-reference): Add tests.
2016-12-13 22:11:41 +01:00
Nicolas Goaziou 64a2f6e22d ox-latex: Fix typo
* lisp/ox-latex.el (org-latex--text-markup): Fix typo.
2016-12-13 14:15:07 +01:00
Nicolas Goaziou 8fec3d5f03 ox-latex: Fix links with special characters
* lisp/ox-latex.el (org-latex--protect-text): Properly escape special
  characters.
(org-latex--text-markup): Adapt to change above.
(org-latex-inline-src-block): Follow `org-latex-text-markup-alist'
specifications.
(org-latex-link): Escape forbidden characters in URL.
2016-12-13 13:46:38 +01:00
Nicolas Goaziou e491ab31c6 ox-latex: Fix nested sub/super-scripts
* lisp/ox-latex.el (org-latex--wrap-latex-math-block): Prevent merging
  multiple sub/super-scripts at the same level.  Nested scripts are
  allowed.
2016-12-13 09:13:22 +01:00
Nicolas Goaziou f747ee43bd ox-beamer: Fix last commit
* lisp/ox-beamer.el (org-beamer-link): Fix commit
  5c28ea6aad.
2016-12-13 09:06:48 +01:00
Nicolas Goaziou 5c28ea6aad ox-beamer: Fix Beamer internal links
* lisp/ox-beamer.el (org-beamer-link): Generate a label compatible
  with "latex" back-end.  Reduce code duplication with "ox-latex.el".

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/110771>
2016-12-12 21:01:02 +01:00
Nicolas Goaziou d777418ac6 org-colview: Fix `org-agenda-overriding-columns-format'
* lisp/org-colview.el (org-columns--collect-values): Change signature.
(org-agenda-columns): Apply signature change.

When calling `org-agenda-columns' compiled columns format is set
locally to Agenda buffer, but `org-columns--collect-values' is called
from source buffers.  Therefore, it uses default format instead of the
compiled one.

Reported-by: Christian Prothmann <ckprothmann@yahoo.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110748>
2016-12-11 01:34:55 +01:00
Nicolas Goaziou 00ea6a286c ob-tangle: Fix last commit
* lisp/ob-tangle.el (org-babel-tangle-single-block):
  `org-babel-expand-noweb-references' specifically needs to be run in
  the Org document so as to resolve references.
* testing/lisp/test-ob-tangle.el (ob-tangle/continued-code-blocks-w-noweb-ref):
  Make sure a failing test doesn't leave a file behind it.
2016-12-10 00:59:08 +01:00
Nicolas Goaziou 7b148e2d0e ob-tangle: Respect buffer local variables
* lisp/ob-tangle.el (org-babel-spec-to-string): Move some processing...
(org-babel-tangle-single-block): ... there.  This function is called
with the Org buffer as its original buffer whereas the previous one is
not.

This is a follow-up to 026fb75, which was reverted.

Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110670>
2016-12-10 00:20:38 +01:00
Nicolas Goaziou 04799d8e39 Revert "ob-tangle: Respect buffer local variables"
This reverts commit 026fb75ddb.
2016-12-10 00:19:45 +01:00
Nicolas Goaziou e32aca36a4 Simplify matching headlines in `org-link-search'
* lisp/org.el (org-link-search): Simplify matching headlines.
2016-12-08 22:40:18 +01:00
Paul Eggert b7cb9b54d5 Backport commit eeecac7 from Emacs
Fix minor quoting problems in doc strings
eeecac7ab9d1f8c3a29cffe4586e5fd2414dd671
Paul Eggert
Wed Dec 7 11:31:16 2016 -0800
2016-12-07 22:33:31 -05:00
Nicolas Goaziou 3c64f06617 Allow coderef on otherwise empty lines
* lisp/org-src.el (org-src-coderef-regexp): Update regexp.
* lisp/ox.el (org-export-resolve-coderef): Use function above.

Reported-by: D M German <dmg@turingmachine.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110656>
2016-12-07 23:11:10 +01:00
Nicolas Goaziou c797cc0f87 ox-latex: Do not generate nested sub/superscripts
* lisp/ox-latex.el (org-latex--wrap-latex-math-block): Do not wrap
  consecutive sub or super-scripts within the same block.

Reported-by: Scott Otterson <scotto@sharpleaf.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110589>
2016-12-07 00:45:52 +01:00
Nicolas Goaziou 6ed3fc8010 Fix SCHEDULED removal when repeating a task
* lisp/org.el (org-auto-repeat-maybe): Fix bug where repeating a task
  containing a timestamp without a repeater would remove the scheduled
  date.

Reported-by: 毛晓伟 <maoweirm@126.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110633>
2016-12-07 00:10:29 +01:00
Nicolas Goaziou 026fb75ddb ob-tangle: Respect buffer local variables
* lisp/ob-tangle.el (org-babel-tangle): Make sure buffer local
  variables from Org document are taken into consideration in tangled
  document.

Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110577>
2016-12-03 23:55:28 +01:00
Nicolas Goaziou e72485336f org-agenda: Fix face for past scheduled time stamps
* lisp/org-agenda.el (org-agenda-get-scheduled): Fix face.
2016-12-02 23:24:38 +01:00
Nicolas Goaziou 9950252f34 org-agenda: Fix repeats with nil `org-agenda-repeating-timestamp-show-all'
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled): When
`org-agenda-repeating-timestamp-show-all' is nil, only display repeat
before and repeat after today (or only repeat at today if those
coincide).  Also, computations of warnings are done with last repeat
before today instead of base date.
2016-12-02 13:01:22 +01:00
Nicolas Goaziou 6d5e207c7d org-agenda: Small refactoring
* lisp/org-agenda.el (org-agenda-deadline-face): Small refactoring.
2016-12-02 13:01:22 +01:00
Nicolas Goaziou e336f39ce7 Fix dpi calculation when previewing LaTeX snippets
* lisp/org.el (org--get-display-dpi): Fix docstring.
(org-create-formula-image): Use function above.

Reported-by: Scott Otterson <scotto@sharpleaf.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110526>
2016-11-30 21:55:45 +01:00
Nicolas Goaziou c3146209ec org-agenda: Fix priority for deadlines
* lisp/org-agenda.el (org-agenda-get-deadlines): Fix priority
  computation.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110519>
2016-11-30 00:16:56 +01:00
Nicolas Goaziou ba06303016 org-agenda: Fix time of day presence
* lisp/org-agenda.el (org-agenda-get-deadlines): Small refactoring.
(org-agenda-get-scheduled): Do no insert a time of day when current
entry is only a reminder of a previously scheduled task.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110517>
2016-11-29 23:55:15 +01:00
Lixin Chin f5916c4fbb Relax the match criteria for MathML header line
* lisp/org.el (org-create-math-formula): Allow the xmlns attribute to
  be preceded by any other mathml header attribute.

The problem here was that the match criteria for MathML assumed that
the xmlns attribute is the first listed in the top level MathML <math>
element.  Some LaTeX -> MathML converters (e.g., pandoc) will add
attributes before xmlns, which is still valid MathML.
2016-11-29 09:28:06 +01:00
Lixin Chin 73694b21d7 ox-odt.el: Fix LaTeX formulae in opendocument exports
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Apply signature
  change for `org-format-latex'.

Commit a24f339f58 changed the signature
for `org-format-latex' (lisp/org.el) to add `beg' and `end' optional
parameters.  This led to an error in ox-odt.el when exporting an
odt document containing LaTeX formulae.
2016-11-29 09:24:11 +01:00
Kyle Meyer 6983f8e8bf Issue user-error when trying to drag before first element
* lisp/org.el (org-drag-element-backward):
(org-drag-element-forward): Check that org-element-at-point returns a
non-nil value to avoid a type-error when called before first element.

* testing/lisp/test-org.el (test-org/drag-element-backward):
(test-org/drag-element-forward): Add test for when point is before
first element.  Adjust existing should-error calls to specify
user-error.
2016-11-28 18:40:43 -05:00
Nicolas Goaziou 9299efa351 org-agenda: Fix deadlines
* lisp/org-agenda.el (org-agenda-get-deadlines): Fix deadlines
  display.  Also improve priority adjustment.
2016-11-28 01:35:21 +01:00
Nicolas Goaziou 6907766913 org-agenda: Fix docstrings
* lisp/org-agenda.el (org-agenda-skip-scheduled-if-done): Tiny rewording.
(org-agenda-skip-deadline-if-done): Fix typo.
2016-11-27 23:45:35 +01:00
Nicolas Goaziou abbf497b84 org-agenda: Fix done scheduled display
* lisp/org-agenda.el (org-agenda-get-scheduled): Skip done scheduled
  unconditionally whenever the base date is not the one currently
  considered.
2016-11-27 23:43:00 +01:00
Nicolas Goaziou 4b99ed5eb0 org-agenda: Fix repeated time stamps
* lisp/org-agenda.el (org-agenda-get-timestamps): Properly handle
  repeated time stamps.  Refactor code.  Improve docstring.
2016-11-27 23:09:23 +01:00
Nicolas Goaziou 2998a139c4 Tiny fix
* lisp/org.el (org-at-clock-log-p): Use `beginning-of-line' instead of
  `move-beginning-of-line'.
2016-11-27 23:09:15 +01:00
Nicolas Goaziou 7fc980f75e Tiny docstring fix
* lisp/org.el (org-compile-file): Fix docstring.
2016-11-27 12:20:01 +01:00
Nicolas Goaziou 289363d510 Fix LaTeX preview
* lisp/org.el (org-compile-file): Introduce new %O placeholder.
(org-preview-latex-process-alist): Use it.

* lisp/ox-latex.el (org-latex-pdf-process):
* lisp/ox-man.el (org-man-pdf-process):
* lisp/ox-texinfo.el (org-texinfo-info-process): Document it.

Reported-by: Scott Otterson <scotto@sharpleaf.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110464>
2016-11-27 12:07:11 +01:00
Nicolas Goaziou ee7721f795 org-clock: Fix clock tables with file list scope
* lisp/org-clock.el (org-dblock-write:clocktable): Handle scope as
  a list of files.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110452>
2016-11-26 00:15:44 +01:00
Nicolas Goaziou b77ef877ab org-agenda: Fix "no-catch --cl-block-nil--"
* lisp/org-agenda.el (org-agenda-get-category-icon): Use `cl-dolist'
  instead of `dolist'.

Reported-by: Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/110443>
2016-11-25 17:49:13 +01:00
Nicolas Goaziou 2e35a59763 ox-latex: Fix error when compiling in a different than source file
* lisp/ox-latex.el (org-latex-compile): List logfiles with their full
  name instead of relative ones.

Reported-by: Éric Würbel <eric.wurbel@univ-amu.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/110402>
2016-11-25 12:22:54 +01:00
Nicolas Goaziou 26828778c6 org-agenda: Fix previous commit
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-deadlines): Apply `org-agenda--timestamp-to-absolute'
signature change.
2016-11-25 02:07:54 +01:00
Nicolas Goaziou 69ec6258b6 org-agenda: Fix scheduled dates display
* lisp/org.el (org-time-string-to-absolute): Change signature.
* lisp/org-agenda.el (org-agenda-get-scheduled): Fix various glitches
  in scheduled dates display.  Also fix such dates when
  `org-agenda-repeating-timestamp-show-all' is nil.  Apply signature
  change.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110116>
2016-11-25 01:51:42 +01:00
Nicolas Goaziou 0dd024aa92 ob-js: Fix error when code block ends with a comment
* lisp/ob-js.el (org-babel-js-function-wrapper): Isolate body within
  wrapper.

Reported-by: Compro Prasad <comproprasad@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110390>
2016-11-21 23:21:23 +01:00
Nicolas Goaziou 1319a3be44 ox-html: Fix %d placeholder in pre/postamble string
* lisp/ox-html.el (org-html-format-spec): Correctly apply
  `org-html-metadata-timestamp-format' on %d placeholder.

Reported-by: Pavel Panchekha <me@pavpanchekha.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110374>
2016-11-19 23:17:32 +01:00
Nicolas Goaziou c3c33841eb Merge branch 'maint' of orgmode.org:org-mode into maint 2016-11-19 23:08:33 +01:00
Nicolas Goaziou 9e2dc98eef Fix error when exporting body only of an empty buffer
* lisp/ox.el (org-export-filter-apply-functions): Return empty string
  instead of nil when a filter returns the empty string.

* testing/lisp/test-ox.el (test-org-export/export-scope): Add test.
(test-org-export/filter-apply-functions): New test.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/110371>
2016-11-19 23:08:12 +01:00
Paul Eggert ad5e2aed21 Backport commit dc152c5 from Emacs
Apple changed the spelling of its operating system again, to "macOS",
effective with macOS 10.12 Sierra (2016-09-20).  Change Emacs
documentation and comments to match this.  Stick with older OS
spellings ("OS X", "Mac OS X") when talking about older releases where
the older names are more correct.

Modernize usage of 'macOS' in doc and comments
dc152c54f4e44f5f2040883b03f71ff6aa66c893
Paul Eggert
Sun Nov 6 00:42:03 2016 -0700
2016-11-19 16:49:15 -05:00
Nicolas Goaziou b3125dc84b ox-icalendar: Use \r\n instead of \n as line breaks
* lisp/ox-icalendar.el (org-icalendar-fold-string): Break lines with
  \r\n instead of \n, per RFC 5545.

Reported-by: Stephen Eglen <sje30@cam.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/110306>
2016-11-18 23:03:01 +01:00
Nicolas Goaziou 8a5e54f1cc Small fix to documentation
* doc/org.texi (Setting tags): Remove misleading information.
* lisp/org.el (org-tag-alist): Fix consistency with
  `org-tag-persistent-alist'.
2016-11-13 18:08:15 +01:00
Nicolas Goaziou cec084584d Fix docstring
* lisp/org.el (org-link-search-must-match-exact-headline): Fix
  docstring.  Add :safe keyword.
2016-11-13 11:37:53 +01:00
Nicolas Goaziou ebbc675bd9 Fix TODO keywords case sensitivity
* lisp/org.el (org-todo-regexp):
(org-not-done-regexp):
(org-not-done-heading-regexp):
(org-todo-line-regexp):
(org-complex-heading-regexp): Improve docstrings.

(org-insert-todo-heading):
(org-fix-position-after-promote):
(org-link-search):
(org-block-todo-from-children-or-siblings-or-parent):
(org-get-todo-state):
(org-priority):
(org-point-at-end-of-empty-headline):
* lisp/org-agenda.el (org-fix-agenda-info):
(org-agenda-get-todos):
(org-cmp-alpha):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-all-done):
* lisp/org-list.el (org-toggle-item):
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead): Bind
`case-fold-search' to nil when matching aginst one of the regexp
above.

* testing/lisp/test-org.el (test-org/fuzzy-links): Add tests.
2016-11-13 11:26:17 +01:00
Nicolas Goaziou ff0748beac Small documentation fixes
* doc/org.texi (The very busy C-c C-c key):
* lisp/org.el (org-startup-folded): Documentation fixes.
2016-11-12 01:45:05 +01:00
Nicolas Goaziou 393f490386 Remove dependency on "gs" for preview LaTeX
* lisp/org.el (org-preview-latex-process-alist): Remove "gs"
  requirement.

Reported-by: Frederick Giasson <fred@fgiasson.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110216>
2016-11-12 01:21:25 +01:00
Nicolas Goaziou 31a112d4dd org-clock: Add missing space in clock line
* lisp/org-clock.el (org-clock-get-clock-string): Add missing space in
  clock line when no effort is defined.

Reported-by: Allen Li <vianchielfaura@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110235>
2016-11-12 01:09:00 +01:00