Commit Graph

13193 Commits

Author SHA1 Message Date
Nicolas Goaziou 500abcd7fb ob-core: Fix `org-babel-balanced-split'
* lisp/ob-core.el (org-babel-balanced-split): Rewrite function.

Reported-by: Moritz Heidkamp <moritz@twoticketsplease.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113204>
2017-05-01 23:35:39 +02:00
Nicolas Goaziou 823c821bc8 ob-core: Small refactoring
* lisp/ob-core.el (org-babel-read): Small refactoring.
(org-babel--string-to-number): Use `string-match-p' instead of
`string-match'.
* lisp/org-compat.el (org-babel-number-p): Move obsolete alias.
2017-05-01 15:33:09 +02:00
Nicolas Goaziou 3502e6fa7c Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Correctly indent line
  when last element in an item is not a greater element.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2017-04-30 22:26:10 +02:00
Kyle Meyer 2a37760dfd Fix some documentation typos
* lisp/org-agenda.el (org-agenda-show-inherited-tags):
* lisp/org-element.el (Accessors and Setters):
(org-element-parse-buffer): Fix documentation typos.
2017-04-30 15:11:45 -04:00
Nathaniel Nicandro e527e49c38 ob-python: Honor the :python header argument in python src blocks
* lisp/ob-python.el (org-babel-execute:python):
`org-babel-python-command` should be set before calling
`org-babel-python-initiate-session`.

TINYCHANGE
2017-04-29 16:26:33 +02:00
Nicolas Goaziou 1332bbd616 ox: Do not trim leading and trailing blank lines from code
* lisp/ox.el (org-export-get-loc):
(org-export-unravel-code):
(org-export-format-code):
(org-export-format-code-default): Do not trim leading and trailing
blank lines from code during export.

* testing/lisp/test-ox.el (test-org-export/unravel-code): Update tests.
(test-org-export/format-code-default): Add tests.

Reported-by: Li DebugFan <debugfanli@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113205>
2017-04-29 14:32:29 +02:00
Nicolas Goaziou 91236a3db3 org-src: Fix indentation when tabs are involved
* lisp/org-src.el (org-src--source-type):
(org-src--tab-width): New variables.
(org-src--edit-element): Set variables above.

(org-src--contents-for-write-back): Re-indent properly non-blank lines
before inserting contents back into the source buffer.
(org-edit-src-code): Delegate block indentation to
`org-src--contents-for-write-back'.

* testing/lisp/test-org-src.el (test-org-src/indented-blocks): New
  test.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113207>
2017-04-29 11:45:45 +02:00
Nicolas Goaziou cb5ca4206f org-clock: Fix failing tests
* lisp/org-clock.el (org-clock-get-table-data): `org-get-heading' only
  accepts up to 2 arguments in Org 9.0.
2017-04-29 10:25:57 +02:00
Nicolas Goaziou 8dfcdedf44 org-colview: Fix agenda columns with diary entries
* lisp/org-colview.el (org-agenda-columns): Do not treat diary entries
  as headlines.

Reported-by: "Éibhear" <eibhear.geo@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113282>
2017-04-28 00:23:49 +02:00
Allen Li da83e7d583 org-agenda: Store stuck project redo command
* lisp/org-agenda.el (org-agenda-list-stuck-projects): Store the redo
command in a text property so it is found correctly.

`org-agenda-redo' checks the `org-redo-cmd' text property, not
`org-agenda-redo-command'.

TINYCHANGE
2017-04-25 23:46:50 +02:00
Иван Трусков 411e9e0816 ob-C: Fix command to perform on remote host
* lisp/ob-C.el (org-babel-C-execute): Make sure name of compiled
program is converted to local representation before sending it to the
shell on remote host.

The problem was when one would try to evaluate C source code block in
the file on remote host.  Compilation would go normally, then
evaluation would fail with error like "/bin/sh: unable to find file".

TINYCHANGE
2017-04-25 10:08:48 +02:00
Christian Garbs a91eae6d52 Backport commit c68cce94c from Emacs
; Fix typo in error messages (Bug#26034)
c68cce94c46140f2ad1411550427d3cc2658ec02
Christian Garbs
Mon Apr 17 07:07:12 2017 +0300

TINYCHANGE
2017-04-23 19:44:21 -04:00
Matt Lundin 8f4989d00d org-protocol: Don't push url to kill-ring
* lisp/org-protocol.el: (org-protocol-do-capture) Don't push link to
  kill-ring when invoking `org-protocol-capture'.  Otherwise,
  `org-protocol-do-capture' interferes with capture templates that
  insert the contents of the clipboard or the kill ring.
2017-04-18 08:26:42 +02:00
Nicolas Goaziou 68f60dbdd5 org-capture: Fix typo
* lisp/org-capture.el (org-capture-fill-template): Fix typo introduced
  in last commit.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113126>
2017-04-17 20:04:09 +02:00
Nicolas Goaziou 03873f070c org-capture: Fix clipboard history with %^C or %^L place holders
* lisp/org-capture.el (org-capture--clipboards): New variable.
(org-capture-fill-template): Use new variable.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://permalink.gmane.org/gmane.emacs.orgmode/113020>
2017-04-17 14:18:06 +02:00
Nicolas Goaziou 137c6ad658 org-protocol: Do not catch all errors when providing backward compatibility
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol): Do
  not catch every error so as to ease old style support.  Re-format
  code to fit within 80 columns.

Reported-by: Adam Porter <adam@alphapapa.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/113102>
2017-04-17 11:03:47 +02:00
Marc Ihm 165f7c3950 Fix explanation, if state change is blocked by contained checkboxes
* lisp/org.el (org-todo): Fix explanation, if state change is blocked
  by contained checkboxes.

Consider a node, which contains unchecked checkboxes; if you have set
org-enforce-todo-checkbox-dependencies and try to change the node to
DONE, you will be denied with a message explaining why. However in this
special case the explanation would be wrong in talking of an unrelated
node instead of the checkboxes.

The fix uses the already existing variable org-blocked-by-checkboxes
(which is handled in org-block-todo-from-checkboxes).  Similar code is
already present in org-agenda-dim-blocked-tasks within org-agenda.el.
2017-04-17 10:33:51 +02:00
Nicolas Goaziou 6bd5210535 org-clock: Silence byte-compiler 2017-04-17 10:04:54 +02:00
Nicolas Goaziou 58ba690e33 org-clock: Fix :link parameter in Clock table
* lisp/org-clock.el (org-clock-get-table-data): Fix link creation with
  headlines containing COMMENT or TODO keywords.  Fix docstring.
  Small refactoring.

Reported-by: "Stacey Marshall" <stacey.marshall@oracle.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113094>
2017-04-17 10:02:46 +02:00
Kyle Meyer 7fb6ab52c4 Don't call kill-this-buffer outside of menus
* contrib/lisp/org-toc.el (org-toc-quit):
* lisp/org-mhe.el (org-mhe-follow-link): Use kill-buffer rather than
  menu-bar.el's kill-this-buffer.

See Emacs bug#26466 and discussion on emacs.devel:
https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00346.html.

This is in favor of backporting Emacs's 2e4f4c9d48 (Don't call
'kill-this-buffer' outside of menus, 2017-04-12), which introduces a
new function kill-current-buffer that provides special handling of
minibuffers.
2017-04-16 17:07:44 -04:00
Nicolas Goaziou de7e495e46 ox-latex: Remove unwanted indentation in horizontal rules
* lisp/ox-latex.el (org-latex-horizontal-rule): Add "\noindent" macro
  before the horizontal rule.

Reported-by: Justen Rickert <justenrickert@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113092>
2017-04-16 09:33:33 +02:00
Xi Shen 93972c9845 ob-sql.el: Fix filename conversion in minGW environment.
(org-babel-sql-convert-standard-filename): If it is not in Cygwin
environment, and `system-nt' is "windows-nt", Emacs must be in minGW
or MSYS environment, and can handle Windows filename correctly.

TINYCHANGE
2017-04-16 09:24:06 +02:00
aviv 842a75828f Updating MathJax CDN links
* doc/org.texi : Change reference to "cdn.mathjax.org" to "cdnjs.com",
  removing comment about no longer relevant terms of service.
* lisp/ox-html.el (org-html-mathjax-options) : Change link to
  appropriate cdnjs.com link to load MathJax.

Updating MathJax CDN links to reflect cdnjs.com as cdn.mathjax.org
will be disconitnued as of 30 April 2017.

TINYCHANGE
2017-04-16 08:59:05 +02:00
Nicolas Goaziou 8a2ffac88a org-element: Fix radio link parser
* lisp/org-element.el (org-element--object-lex): Fix parsing of radio
  links within emphasis.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.

Reported-by: R C <recifx@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113063>
2017-04-15 17:27:01 +02:00
Nicolas Goaziou 74379eaaa2 Fix `org-forward-heading-same-level'
* lisp/org.el (org-forward-heading-same-level): Do not fail when
  heading is at the beginning of the buffer.
* testing/lisp/test-org.el (test-org/forward-heading-same-level): New
  test.

Reported-by: Rafael Laboissière <rafael@laboissiere.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/113084>
2017-04-15 16:51:33 +02:00
Ian Dunn a527573076 org-mobile: Fix bug in mobile outline path handling
* org-mobile.el (org-mobile-get-outline-path-link): Use a `:' after
  file instead of a `/'.
2017-04-10 21:16:05 +02:00
Kyle Meyer 10301ab1ff org-insert-link: Correct changes from a08dd527d
* lisp/org.el (org-insert-link): Fix regexp and undefined variable.
2017-04-09 20:49:03 -04:00
Tom Tromey dd40193bfa Backport commit c92bae9a0 from Emacs
* lisp/org-list.el (org-list-insert-radio-list):
* lisp/org-table.el (orgtbl-setup, orgtbl-insert-radio-table): Use
derived-mode-p.

change org to use derived-mode-p
c92bae9a08cc7c2eb61bad32d9a9d6553b6d2c19
Tom Tromey
Wed Apr 5 15:53:38 2017 -0600
2017-04-09 20:48:07 -04:00
Francesco Montanari b2f4f4dc42 ox-man: Add new line before line break tag
* lisp/ox-man.el (org-man-line-break): Transcode a LINE-BREAK object
  from Org to Man by adding the appropriate tag on a new line.

TINYCHANGE
2017-04-01 10:17:01 +02:00
Nicolas Goaziou 31f3725ba8 Fix `org-startup-with-latex-preview' handling
* lisp/org.el (org-mode): When honoring
  `org-startup-with-latex-preview', make sure to preview the whole
  buffer.

Reported-by: Diego Nicola Barbato
<http://permalink.gmane.org/gmane.emacs.orgmode/112925>
2017-03-30 12:46:46 +02:00
Nicolas Goaziou df0c7d96a2 org-clock: Preserve narrowing when building clock table
* lisp/org-clock.el (org-dblock-write:clocktable): Preserve current
  narrowing, if any, when building the table.

Reported-by: Christof Musik <ml-orgmode@litephone.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112872>
2017-03-29 16:33:10 +02:00
Nicolas Goaziou a08dd527d9 Small refactoring
* lisp/org.el (org-insert-link): Small refactoring.
2017-03-29 15:34:27 +02:00
Matt Lundin d9038a01c1 Allow insertion of links with multi-line search strings
* lisp/org.el: (org-insert-link): Fix regexps to match across
  newlines.
2017-03-29 14:28:48 +02:00
Nicolas Goaziou 109c86998e Allow blank lines in text search link
* lisp/org.el (org-link-search): Allow blank lines.

This is a follow-up to 4dde26f08.
2017-03-29 14:12:58 +02:00
Nicolas Goaziou c6b62fd648 ox-latex: Fix last commit
* lisp/ox-latex.el (org-latex--align-string): Fix typo in last commit.
2017-03-27 14:01:32 +02:00
Nicolas Goaziou 7648354952 ox-latex: Fix user-defined align string in matrices
* lisp/ox-latex.el (org-latex--align-string): Change signature.
  Center all cells in matrices, yet preserve user-defined align
  string.
(org-latex--math-table): Apply signature change.

Reported-by: Phil Regier <phil.regier@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112873>
2017-03-27 13:51:55 +02:00
Nicolas Goaziou 4dde26f086 Fix lsearch strings with newline characters
* lisp/org.el (org-link-search): Fix regexp.
* testing/lisp/test-org.el (test-org/fuzzy-links): Add test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112876>
2017-03-27 13:34:04 +02:00
Marco Wahl 82310e34b9 org: Fix tag setter
* lisp/org.el (org-set-tags): Treat ':' and '::' as no tag.
2017-03-26 15:39:20 +02:00
Bastien e3ed81c98d ox-html.el (org-html-scripts): Fix copyright years
* lisp/ox-html.el (org-html-scripts): Fix copyright years.
2017-03-23 23:46:13 +01:00
Nicolas Goaziou b791cd59a5 ox: Fix "Fix :filter-options"
* lisp/ox.el (org-export-as): Remove uninterpreted data from back-end
  specific parsed keywords.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.

This fixes 6cd42b08f9.
2017-03-23 16:46:28 +01:00
Nicolas Goaziou aadde88799 ox: Clarify a docstring
* lisp/ox.el (org-export-get-all-options): Specify return value for
  unknown back-ends.
(org-export--parse-option-keyword):
(org-export--get-subtree-options):
(org-export--get-inbuffer-options):
(org-export--get-global-options): Remove useless check.
2017-03-23 16:38:59 +01:00
Marco Wahl 4b4ccdc3fa org-agenda: Fix agenda buffer name after reload sticky agenda
* lisp/org-agenda.el (org-agenda-list): Don't rename the buffer when
  redoing sticky.

This fix has been proposed by Ian Dunn.

<http://permalink.gmane.org/gmane.emacs.orgmode/112833>

TINYCHANGE
2017-03-21 20:47:30 +01:00
Aaron Jensen 0ccd8286a1 org-src: Fix fontification error
* lisp/org-src.el (org-src-font-lock-fontify-block): Fix fontification
error introduced in commit f2a5104e45.

TINYCHANGE
2017-03-19 23:55:51 +01:00
Yasushi SHOJI d2835ab54d org-clock: Fix percent formula column in clock table
* lisp/org-clock.el (org-clocktable-write-default): Fix percent
  formula column in clock table.
2017-03-19 10:55:44 +01:00
Nicolas Goaziou b72920344f ob-exp: Fix export of src blocks with pathological name
* lisp/ob-exp.el (org-babel-exp-process-buffer): Discard false
  positives.
* testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword):
  New test.

Reported-by: Skip Collins <skip.collins@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112797>
2017-03-18 10:28:15 +01:00
Marco Wahl d262ae53c9 org-agenda: Fix agenda standard name when going unsticky
* lisp/org-agenda.el (org-agenda-list): Reset `org-agenda-buffer-name'
  to the original name.
* testing/lisp/test-org-agenda.el: Pertaining unit test.  + 2 basic
  agenda tests.
* testing/examples/agenda-file.org: File to produce content for an
  agenda to test.
2017-03-17 19:52:22 +01:00
Nicolas Goaziou b5c19643d2 org-agenda: Fix off-by-one scheduled repeat
* lisp/org-agenda.el (org-agenda-get-scheduled): Make the second
  repeat appear as "Sched. 1x".

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/112755>
2017-03-17 08:35:47 +01:00
Bastien e43f247e7c lisp/org-table.el: Bugfix: correctly handle increment of -/+ numbers
* lisp/org-table.el (org-table-copy-down): Bugfix: correctly
handle increment of numbers with a -/+ sign.
2017-03-16 22:15:11 +01:00
Nicolas Goaziou 35ec82bb16 ox-org: Fix footnotes export, part 2
* lisp/ox-org.el (org-org--add-missing-sections): New function.
(org-org-section): Small refactoring.

Since footnote definitions are inserted in the section of the
headline, make sure those are not being skipped.
2017-03-15 14:30:52 +01:00
Nicolas Goaziou 0fd2256eba ox-org: Correctly export footnote references in headlines
* lisp/ox-org.el (org-org-section): Also include references found in
  headlines when inserting footnote definitions at the end of
  a section.

Reported-by: WY H <jcjuly@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112678>
2017-03-15 11:51:16 +01:00
Nicolas Goaziou 6cd42b08f9 ox: Fix :filter-options
* lisp/ox.el (org-export--remove-uninterpreted-data): Do not modify
  communication channel.  Change "blob" to "datum".
(org-export--remove-uninterpreted-data-1): Remove function.
(org-export-as): Remove uninterpreted data from parsed keyword before
applying filters.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/112730>
2017-03-14 18:10:07 +01:00
Nicolas Goaziou 92ee4d06a2 org-capture: Fix escaping characters in template embedded S-exps
* lisp/org-capture.el (org-capture-fill-template): Escape backslash
  characters in %i contents when those are inserted within a S-exp.
  Also prevent adding any prefix to %i contents spanning over multiple
  lines when they are inserted within a S-exp.

* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Add tests.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112232>
2017-03-14 09:03:59 +01:00
Nicolas Goaziou ad19484676 Revert "ox-ascii: Remove useless brackets in sub/super script"
This reverts commit 5b4215eb16.
2017-03-11 11:21:26 +01:00
Nicolas Goaziou a3747baef9 org-agenda: Fix infloop in `org-find-top-headline'
* lisp/org-agenda.el (org-find-top-headline): Prevent infloop when top
  headline has not level 1.

Reported-by: Adrian Bradd <adrian.bradd@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112623>
2017-03-11 11:20:35 +01:00
Nicolas Goaziou 4cb6abe3b7 ox-md: Fix internal links
* lisp/ox-md.el (org-md-headline): Add an anchor when a link is
  referring to the headline.
(org-md--headline-referred-p): New function.
2017-03-10 18:52:06 +01:00
Nicolas Goaziou 5b4215eb16 ox-ascii: Remove useless brackets in sub/super script
* lisp/ox-ascii.el (org-ascii-subscript):
(org-ascii-superscript): Only use brackets when there are multiple
words.
2017-03-08 12:28:28 +01:00
Nicolas Goaziou 2eda74285e Fix LaTeX and Beamer publishing processes
* lisp/ox-beamer.el (org-beamer-publish-to-pdf):
* lisp/ox-latex.el (org-latex-publish-to-pdf): Set default directory
  prior to compiling the generated tex file.

Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/112388>
2017-03-08 09:33:09 +01:00
Nicolas Goaziou 64a5f9a596 ox-html: Fix verse blocks
* lisp/ox-html.el (org-html-verse-block): Add missing line break at
  the end of each line in verse environments.

Reported-by: Skip Collins <skip.collins@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112537>
2017-03-08 00:12:55 +01:00
Nicolas Goaziou a4eb60931a ob-core: Properly escape Org syntax when inserting results
* lisp/ob-core.el (org-babel-examplify-region): Escape Org syntax
  before wrapping it.

* testing/lisp/test-ob.el (test-ob/org-babel-insert-result): Add test.
  Renamed from `test-ob/org-babel-insert-result--improper-lists'.

Reported-by: D M German <dmg@turingmachine.org>
2017-03-01 22:19:04 +01:00
Nicolas Goaziou e1fa353e0a org-protocol: Fix library name
* lisp/org-protocol.el (org-protocol-create-for-org): Use `ox-publish'
  instead of outdated `org-publish'.  Improve warning message.

Reported-by: Jonas Bernoulli <jonasbernoulli@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112386>
2017-02-28 13:37:48 +01:00
Kyle Meyer a29525d657 org-agenda-menu: Correct key for fortnight view
* lisp/org-agenda.el (org-agenda-menu): Correct key for fortnight
  view.

Reported-by: J. David Boyd <dboyd2@mmm.com>
2017-02-27 11:11:20 -05:00
Anders Johansson 4084337dbe org.el: Make faces org-quote and org-verse be appended
* lisp/org.el (org-fontify-quote-and-verse-blocks): Append faces.  Use
  `add-face-text-property'.

This means fontification of emphasis, links etc. is kept in quote and
verse blocks even with org-fontify-quote-and-verse-blocks non-nil.

TINYCHANGE
2017-02-23 14:17:56 +01:00
Nicolas Goaziou da80e6c6ab org-capture: Tiny refactoring
* lisp/org-capture.el (org-capture-refile): Tiny refactoring.
2017-02-23 12:59:24 +01:00
Bastien df506794db org-capture: Fix commit 7d7c38 2017-02-21 15:41:15 +01:00
Nicolas Goaziou 7d7c38c6b1 org-capture: Fix `org-capture-refile'
* lisp/org-capture.el (org-capture-refile): Preserve location of point
  when refiling.

* testing/lisp/test-org-capture.el (test-org-capture/refile): New
  test.

Reported-by: Liu Hui <liuhui1610@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112202>
2017-02-19 15:37:12 +01:00
Axel Kielhorn c5ab7958b7 org-clock: Add german translation.
* lisp/org-clocl.el (org-clock-clocktable-language-setup): German
  translations added.

Axel Kielhorn <org-mode@axelkielhorn.de>
TINYCHANGE
2017-02-19 09:39:06 +01:00
Nicolas Goaziou 70872885be org-src: Fix typo in code comment
* lisp/org-src.el (org-edit-src-save): Fix typo.
2017-02-18 14:56:41 +01:00
Nicolas Goaziou 326894046c org-clock: Fix number of columns with :compact parameter
* lisp/org-clock.el (org-clocktable-write-default): Fix number of
  columns with :compact parameter.

Reported-by: Stefan Nobis <stefan-ml@snobis.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/112217>
2017-02-18 14:22:50 +01:00
Nicolas Goaziou bf601016dc Properly save source blocks with `save-some-buffers'
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Set
  `write-contents-functions' so that saving a remote editing buffer
  always call `org-edit-src-save'.
(org-edit-src-save): Return a non-nil value explicitly.

Reported-by: Thibault Polge <thibault@thb.lt>
<http://permalink.gmane.org/gmane.emacs.orgmode/112201>
2017-02-17 22:32:50 +01:00
Nicolas Goaziou 7ca2e027a6 org-clock: Fix error when using unknown language
* lisp/org-clock.el (org-clocktable-write-default): Be careful
  that (nth 4 lwords) and (nth 5 lwords) can be nil, if :lang as an
  unknown value.
2017-02-17 14:34:19 +01:00
Nicolas Goaziou 013c0af8b0 org-lint: Add checker for empty headlines with tags
* lisp/org-lint.el (org-lint--checkers): Add checker.
(org-lint-empty-headline-with-tags): New function.

* testing/lisp/test-org-lint.el (test-org-lint/empty-headline-with-tags):
  New test.
2017-02-17 13:23:26 +01:00
Fabrice Popineau b5a67ebddd Fix file:// uri handling for windows-nt and cygwin
* lisp/org-element.el (org-element-link-parser):
  Handle drive names in uri like file:///c:/dir/file

* lisp/ox.el (org-export-file-uri):
  Handle drive names in uri like file:///c:/dir/file

* testing/lisp/test-ox.el (test-org-export/file-uri):
  Generate the right uri to be tested against link exporter.
2017-02-17 08:36:00 +01:00
Nicolas Goaziou b897ab7223 org-clock: Fix regression in Clock table
* lisp/org-clock.el (org-clocktable-write-default): Do not raise an
  error when :maxlevel is 0.  Small refactoring.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Split
into ...
(test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/tags):
(test-org-clock/clocktable/scope):
(test-org-clock/clocktable/maxlevel):
(test-org-clock/clocktable/formula): ... these.  Add tests.

This fixes regression introduced in ccf832e83.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112091>
2017-02-13 21:28:59 +01:00
Nicolas Goaziou d347d85a15 org-element: Fix `org-element-insert-before'
* lisp/org-element.el (org-element-insert-before): Do not call
  `reverse' as contents might use `eq' objects.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test

Reported-by: Justin Kirby <justinkirby@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112065>
2017-02-13 16:29:54 +01:00
Stefan-W. Hahn fe97948e89 org-table: Move table column with leaving text-properties untouched
* lisp/org-table.el (org-table-move-column): Use `transpose-regions'.

Moving org-table rows is implemented with delete-region and insert which
preserve text-properties. Moving org-table columns is implemented
with replace-string, which removes text-properties.

My proposal is to use transpose-regions in org-table-move-column which
will preserve text-properties when moving columns in org-tables.
2017-02-13 15:37:53 +01:00
Marco Wahl 9c824217ad org-eww: Fix copy of form-elements
* lisp/org-eww.el (org-eww-copy-for-org-mode): New behavior: Just add
  link-title when link-location is not a string.  This fixes copying
  from www.indeed.co.uk.

Reported and a suggestion of a fix by Andrea.
<http://permalink.gmane.org/gmane.emacs.orgmode/112052>.
2017-02-12 09:00:56 +01:00
Nicolas Goaziou 91d82f7a87 Silence byte-compiler 2017-02-11 18:37:32 +01:00
Nicolas Goaziou 9070b97f0e Fix header in LaTeX snippets
* lisp/ox-latex.el (org-latex-make-preamble): Add optional argument.
* lisp/org.el (org-create-formula-image): Use it.

Reported-by: plus <ctre@users.sourceforge.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/112015>
2017-02-11 02:35:00 +01:00
Nicolas Goaziou ccf832e831 org-clock: Fix clock percent
* lisp/org-clock.el (org-clocktable-write-default): Fix percent computation.
(org-clock-time%): Remove function.

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

As a consequence of this patch, a ":formula %" doesn't generate
a TBLFM line anymore.
2017-02-07 16:52:30 +01:00
Nicolas Goaziou 83cea90599 org-clock: Do not associate a note to removed zero time CLOCKs
* lisp/org-clock.el (org-clock-out): When a zero time CLOCK is
  removed, do not offer to add a note for it.
2017-02-03 22:51:56 +01:00
Nicolas Goaziou 9eda09eab4 Notes associated to CLOCKs are located after the clock
* lisp/org.el (org-store-log-note): Make sure a note added after
  clocking out is inserted right after the CLOCK line.

Reported-by: Jorge Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111795>
2017-02-03 22:46:15 +01:00
Nicolas Goaziou 6da9d0a416 Fix indentation of some elements
* lisp/org.el (org--get-expected-indentation): Tiny refactoring.
(org-indent-line): Ignore LaTex environments.
(org-indent-region): Better handling for export blocks, LaTeX
environments and example blocks.

* testing/lisp/test-org.el (test-org/indent-line):
(test-org/indent-region): Add tests.
2017-02-03 22:03:25 +01:00
Nicolas Goaziou 37bd3586e9 Fix repeating entries without a TODO keyword
* lisp/org.el (org-auto-repeat-maybe): Allow repeating entries without
  a TODO keyword.
2017-02-02 14:17:04 +01:00
Nicolas Goaziou 32972979c7 org-agenda: Fix scheduled and deadline S-exp entries display
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): Properly handle S-exp entries.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111805>
2017-02-01 22:36:29 +01:00
Nicolas Goaziou 73330079c0 org-table: Fix error with `org-table-get-field' at bob
* lisp/org-table.el (org-table-get-field): Do not return
  `beginning-of-buffer' error when called at beginning of buffer.

* testing/lisp/test-org-table.el (test-org-table/get-field): New test.
2017-02-01 20:56:38 +01:00
Nicolas Goaziou 426bce6a83 org-capture: Small fix
* lisp/org-capture.el (org-mks): Find entries with full prefix, not
last pressed key.

This fixes a bug introduced in 8194e7b09.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111779>
2017-01-31 22:50:09 +01:00
Lixin Chin caa54d2e98 ox-latex.el: Wrap 'minted' src blocks in a 'listing' environment
* lisp/ox-latex.el (org-latex-src-block): Make source highlighting
  using the 'minted' syntax highlighting package behave the same as
  using the 'listings' syntax highlighting package.

The source block should be floating if a caption is provided, or if
':float t' is provided in an '#+ATTR_LATEX:' block.  Previously, the
source block would only be floating if ':float multicolumn' was
provided.  This now matches the Org mode documentation for source
blocks.

TINYCHANGE
2017-01-31 09:01:42 +01:00
Nicolas Goaziou 8194e7b09d org-capture: Fix freeze when capture templates are ill-defined
* lisp/org-capture.el (org-mks): Do not freeze when there is a missing
  step in the key hierarchy.  Fix docstring.  Refactor code for clarity.

Reported-by: Roland Everaert <reveatwork@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111716>
2017-01-30 23:36:52 +01:00
Noam Postavsky f2a5104e45 Backport commit ae8264c5cc from Emacs
* lisp/org-src.el (org-src-font-lock-fontify-block): Let-bind
`inhibit-modification-hooks' to nil, since this function can be called
from jit-lock-function which binds that variable to t (Bug#25132).

Call modification hooks in org-src fontify buffers
ae8264c5cccf19d5b25a340a605bf2f07de1577e
Noam Postavsky
Sun Jan 29 11:01:32 2017 -0500
2017-01-29 13:16:09 -05:00
Marco Wahl 39682d4854 Fix: keep repeaters at rescheduling
* lisp/org.el (org--deadline-or-schedule): Removed a blank in a regexp.
* testing/lisp/test-org.el (test-org/schedule): New test.
2017-01-29 16:11:35 +01:00
Nicolas Goaziou ebb9da0d03 Allow C-c C-c on blank lines within src blocks
* lisp/org.el (org-ctrl-c-ctrl-c): Act on blank lines if they are
  located within a src block.

Reported-by: John Hendy <jw.hendy@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111720>
2017-01-27 23:56:30 +01:00
Marco Wahl d715cc42fa Fix `org-refresh-property'
* lisp/org.el(org-refresh-property): Fixed by comparison to the code
  before the refactoring.

With commit 126a1cd7c the "Effort" property broke the agenda.
2017-01-27 19:35:16 +01:00
Nicolas Goaziou 919e864968 Fix internal function name
* lisp/org.el (org-property--local-values): Rename to...
(org--property-local-values): ... this.
(org-entry-get):
(org-entry-get-with-inheritance): Apply renaming.
2017-01-27 00:24:15 +01:00
Nicolas Goaziou 126a1cd7c1 Fix "APPT_WARNTIME" inheritance
* lisp/org.el (org-refresh-properties): Handle inheritance from global
  values (e.g., from "#+PROPERTY:" keyword).
(org-refresh-property): Handle property inheritance with a new
optional argument.

* testing/lisp/test-org.el (test-org/refresh-properties): New test.
2017-01-27 00:21:42 +01:00
Nicolas Goaziou f2e861e0be Small refactoring
* lisp/org.el (org--property-global-value): New function.
(org-entry-get-with-inheritance): Use new function.
2017-01-27 00:10:10 +01:00
Nicolas Goaziou 1f8fb3cf54 Fix `org-property-inherit-p'
* lisp/org.el (org-property-inherit-p): Properties are case insensitive.
2017-01-26 23:10:53 +01:00
Kyle Meyer 7c710f6f57 Change :version in defcustoms from "25.2" to "26.1"
* lisp/ob-J.el (org-babel-J-command):
* lisp/ob-core.el (org-babel-hash-show-time):
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-faces.el (org-block):
* lisp/org-src.el (org-src-block-faces):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-show-context-detail):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-default-process):
(org-preview-latex-process-alist):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.2" to "26.1".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-footnote-defined-format):
(org-latex-images-centered):
(org-latex-default-figure-position):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.2" to "26.1".

It looks like the goal is to sync Org 9.0.* (maint) with the Emacs
master branch (what will be version 26.1):
https://lists.gnu.org/archive/html/emacs-orgmode/2017-01/msg00558.html
2017-01-26 00:02:03 -05:00
Kyle Meyer c1822e5560 Clean up spacing to pass Emacs's pre-commit check
Like 00dacdcc5 (2015-08-10), this is in preparation for syncing with
the Emacs repo.
2017-01-25 22:21:59 -05:00
Kyle Meyer ffa4502771 ob-core: Move org-babel-local-file-name to org-compat.el
* lisp/ob-core.el (org-babel-process-file-name): Move to
org-compat.el.
* lisp/org-compat.el (org-babel-local-file-name): Add compatibility
alias.
2017-01-25 22:00:48 -05:00
Michael Albinus e97f04de8e Backport commit 22946702b from Emacs
* lisp/ob-core.el (org-babel-local-file-name): Use `file-local-name'
when available.

22946702b4296c0e42e4baf6221e205b52d05cbf
Michael Albinus
Sun Nov 20 16:29:47 2016 +0100
2017-01-25 22:00:48 -05:00