Commit Graph

11748 Commits

Author SHA1 Message Date
Archenoth 81a6372947 ob-ruby: Fix double-escaping
* lisp/ob-ruby.el (org-babel-ruby-evaluate): Remove second call to
  `org-babel-ruby-table-or-string'.

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

TINYCHANGE
2015-08-12 22:55:54 -04:00
Nicolas Goaziou 4bb5306f2d Merge branch 'maint' 2015-08-13 02:44:02 +02:00
Nicolas Goaziou 4dc79cbe9d Fix splitting headlines with RET
* lisp/org.el (org-return): Make sure to keep headline from being
  invalidated by restricting positions where it can be split.

* testing/lisp/test-org.el (test-org/return): Add test.
2015-08-13 02:42:08 +02:00
Alexey Lebedeff 997a9a45d9 Make `org-return' follow links in headings again
* org.el (org-return): Check for links first when
  `org-return-follows-link' is non-nil, before inserting any newlines.

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

This patch restores order in which `org-return' perform actions (which
was changed in a7e62499f2).

TINYCHANGE
2015-08-13 02:25:17 +02:00
Nicolas Goaziou 128c132c60 Merge branch 'maint' 2015-08-12 14:53:56 +02:00
Nicolas Goaziou 1e268ad334 org-colview: Fix column view area
* lisp/org-colview.el (org-columns-goto-top-level): Actually move point.
(org-columns): Adapt to change above.

Reported-by: Johan Sandblom <js@ndblom.se>
<http://permalink.gmane.org/gmane.emacs.orgmode/99892>
2015-08-12 14:49:02 +02:00
Nicolas Goaziou 252029b10b Merge branch 'maint' 2015-08-12 01:13:38 +02:00
Nicolas Goaziou 0359f7550a org-colview: Fix typo in a docstring
* lisp/org-colview.el (org-columns--value): Fix typo.
2015-08-12 01:12:43 +02:00
Nicolas Goaziou 3add787abd Merge branch 'maint' 2015-08-11 19:12:49 +02:00
Nicolas Goaziou 6116c72975 Fix column view sums
* lisp/org.el (org-entry-properties): Remove need for `org-summaries'
  property.

* lisp/org-colview.el (org-columns--value): New function.
(org-columns):
(org-agenda-columns): Use new functions.

Reported-by: Johan Sandblom <js@ndblom.se>
<http://permalink.gmane.org/gmane.emacs.orgmode/99865>
2015-08-11 19:12:17 +02:00
Nicolas Goaziou 05994dc775 Merge branch 'maint' 2015-08-11 14:46:14 +02:00
Nicolas Goaziou e8253c57f1 org-agenda: Fix slowdown introduced in 570b193
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Do not check
multiple times the same entry.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/99842>
2015-08-11 14:42:34 +02:00
Nicolas Goaziou 4a7b2c5072 Merge branch 'maint' 2015-08-11 14:13:46 +02:00
Nicolas Goaziou 9bb87f49f7 org-list: Fix "Invalid search bound" error
* lisp/org-list.el (org-update-checkbox-count): Fix "Invalid search
  bound" error.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/99837>
2015-08-11 14:11:15 +02:00
Nicolas Goaziou a0c634ba3c Merge branch 'maint' 2015-08-10 23:24:06 +02:00
Nicolas Goaziou ac0661189e org-list: Fix statistics updating with cookie in sublist
* lisp/org-list.el (org-update-checkbox-count): Properly update
  statistics cookies in a sublist.

* testing/lisp/test-org-list.el (test-org-list/update-checkbox-count):
Add test.

Reported-by: Gerald Wildgruber <Gerald.Wildgruber@unibas.ch>
<http://permalink.gmane.org/gmane.emacs.orgmode/99792>
2015-08-10 23:23:39 +02:00
Nicolas Goaziou e658b07c8a Merge branch 'maint' 2015-08-10 22:36:02 +02:00
Nicolas Goaziou aa98f7c79a Edit proper timestamp when on a time range
* lisp/org.el (org-time-stamp): Offer appropriate default value
  depending on position of point in a time range.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99783>
2015-08-10 22:32:24 +02:00
Nicolas Goaziou a472043b74 Fix ambiguous docstrings
* lisp/org.el (org-at-date-range-p):
(org-at-timestamp-p): Make match data explicit when returning a non-nil
value.
2015-08-10 22:31:31 +02:00
Kyle Meyer caf762e9bc Merge branch 'maint' 2015-08-10 12:19:59 -04:00
Kyle Meyer 408f6da74d org-clock: Fix org-add-archive-files call
* lisp/org-clock.el (org-dblock-write:clocktable): Check that
  buffer-file-name is non-nil before passing to org-add-archive-files.
2015-08-10 12:19:39 -04:00
Kyle Meyer 44c8cd7136 org-map-entries: Fix org-agenda-prepare-buffers call
* lisp/org.el (org-map-entries): Check that buffer-file-name is non-nil
  before passing to org-agenda-prepare-buffers.

Like 11e8749, this surfaced as an error when 05efa7a ("Backport commit
3a5f751 from Emacs master branch", 2015-08-08) replaced a
'(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)',
resulting in the body being executed when '(nil)' was passed to
org-agenda-prepare-buffers.

Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/99779>
2015-08-10 12:19:13 -04:00
Nicolas Goaziou b911f17fc3 Merge branch 'maint' 2015-08-10 13:58:40 +02:00
Nicolas Goaziou 07a2d3d6f5 Fix agenda wrt commented headlines
* lisp/org.el (org-agenda-prepare-buffers): Ignore commented headlines
  deeper than level 1.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99529>
2015-08-10 13:54:19 +02:00
Nicolas Goaziou 898cfbcac0 Implement faster `show-children' function
* lisp/org.el (org-show-children): New function.
(org-cycle-internal-local):
(org-set-visibility-according-to-property):
(org-content):
(org-move-subtree-down):
(orgstruct-setup):
(org-show-set-visibility):
* contrib/lisp/org-toc.el (org-toc-cycle-subtree):
(org-toc-restore-config):
* lisp/org-agenda.el (org-agenda-show-1):
* lisp/org-feed.el (org-feed-update): Use new function.

* etc/ORG-NEWS: Document new function.

Suggested-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99616>
2015-08-10 13:37:29 +02:00
Nicolas Goaziou 7204ba0e46 Fix infloop due to wrong angle link regexp
* lisp/org.el (org-make-link-regexps): Fix infloop.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/99779>
2015-08-10 10:04:09 +02:00
Kyle Meyer 8d2c6af7ed Update remaining copyright years in lisp/ 2015-08-10 02:17:52 -04:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Kyle Meyer f6aa5341cb org-cycle-agenda-files: Fix agenda file check
* lisp/org.el (org-cycle-agenda-files): Raise error if there are no
  agenda files, as intended.  Simplify code.
2015-08-09 21:39:18 -04:00
Kyle Meyer 11e8749102 org-clock: Fix org-agenda-prepare-buffers call
* lisp/org-clock.el (org-dblock-write:clocktable): Pass buffer to
  org-agenda-prepare-buffers when buffer is not visiting file.

This surfaced as an error when 05efa7a ("Backport commit 3a5f751 from
Emacs master branch", 2015-08-08) replaced a
'(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)',
resulting in the body being executed when '(nil)' was passed to
org-agenda-prepare-buffers.
2015-08-09 21:39:18 -04:00
Kyle Meyer 04aea5ea6f org-local-logging: Replace let* with let
* lisp/org.el (org-local-logging): Replace let* with let.
2015-08-09 21:39:18 -04:00
Kyle Meyer 906034b1a1 Partially revert last backport
* lisp/org.el (org-assign-fast-keys, org-make-tags-matcher)
(org-cycle-agenda-files): Revert dolist change because code in body
expects the list to be modified by pop each iteration.
(org-fast-todo-selection, org-fast-tag-selection): Revert dolist change
because code in body expects the list to be modified by pop each
iteration and because the variable name is used outside of the dolist
body.
2015-08-09 21:28:27 -04:00
Stefan Monnier ef96370304 Backport commit 3a5f751 from Emacs master branch
* lisp/org.el (org-goto-map, org-assign-fast-keys)
(org-contextualize-keys, org-contextualize-validate-key)
(org-notes-order-reversed-p, org-local-logging, org-map-entries)
(org-find-olp, org-find-exact-heading-in-directory)
(org-cycle-agenda-files, org-release-buffers, org-fill-template)
(org-agenda-prepare-buffers, org-occur-in-agenda-files)
(org-replace-escapes): Use dolist.
(org-mode): Optimize away XEmacs-only code.
(org-refile-get-targets): Remove unused var `f'.
(org-fast-todo-selection): Remove unused var `e'.
(org-make-tags-matcher): Use dolist.  Remove unused var `term'.
(org-fast-tag-selection): Use dolist.  Remove unused var `e'.
(org-format-latex): Use dolist.  Remove unused var `e'.
(org-backward-sentence, org-forward-sentence, org-meta-return)
(org-kill-line): Mark arg as unused.
(org-submit-bug-report): Silence compiler warning.
(org-occur-in-agenda-files): Don't use add-to-list on local vars.
(org-get-cursor-date): Remove unused var `tm'.
(org-comment-or-uncomment-region): Use standard name `_'.
(reftex-docstruct-symbol, reftex-cite-format): Declare to
silence byte-compiler.
(org-reftex-citation): Add `org--' prefix to dynamically scoped
`rds' var.

org.el: Fix up some lexical scoping warnings, and use dolist
3a5f75193ed10ee5fb458e9879340947f31d5e12
Stefan Monnier
Sat Aug 8 19:41:57 2015 -0400
2015-08-09 21:28:06 -04:00
Nicolas Goaziou 3b20eed34a Open timestamps also on CLOCK lines
* lisp/org.el (org-open-at-point): CLOCK are a valid location for
  timestamps.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99754>
2015-08-10 00:18:16 +02:00
Nicolas Goaziou c9ac8f6956 Fix false positives in TODO keywords
* lisp/org.el (org-entry-properties): Make sure case is meaningful when
  matching a TODO keyword.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99756>
2015-08-09 23:56:57 +02:00
Nicolas Goaziou 46f3f4c626 org-table: Fix number-or-marker-p error
* lisp/org-table.el (org-table-goto-field): Fix number-or-marker-p
  error.

Initial patch by Rasmus <rasmus@gmx.us>.

Reported-by: Scott Randby <srandby@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99715>
2015-08-09 02:12:47 +02:00
Nicolas Goaziou 134d5983ec Fix visibility when switching from agenda to item
* lisp/org-agenda.el (org-agenda-switch-to): Do not hardcode visibility
  set-up when switching to item relative to current agenda line.
  Instead let `org-show-context' handle it.  Improve docstring.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99616>
2015-08-07 02:13:06 +02:00
Nicolas Goaziou 570b1935e7 org-agenda: Do not block non-TODO entries
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Do not check if an
  entry can be blocked when it doesn't have any TODO keyword.

* lisp/org.el (org-entry-blocked-p): Make sure entry is really an open
  task before even considering it as a blocked task.  Small refactoring.

* testing/lisp/test-org.el (test-org/entry-properties): Update tests.
(test-org/entry-blocked-p): New test.

Reported-by: Bingo UV <right.ho@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99544>
2015-08-06 17:56:40 +02:00
Nicolas Goaziou b1d3a904f1 Tiny fix
* lisp/org.el (org-get-tag-face): Tiny fix.
2015-08-06 15:41:16 +02:00
Nicolas Goaziou 3a632fa201 Fontify priorities, tags and TODO in colview
* lisp/org.el (org-get-priority-face): New function.
(org-font-lock-add-priority-faces): Use new function.

* lisp/org-colview.el (org-columns-new-overlay): Preserve face from
  string to display.
(org-columns-display-here): Apply usual face on TODO keywords, tags and
priorities in the columns overlay.
2015-08-06 15:35:44 +02:00
Nicolas Goaziou dc1ed4cdcc Revert "org-colview: Preserve face for TODO keywords"
This reverts commit 96b4e8f74b.

Font leaks on the vertical bar after the keyword.
2015-08-06 15:34:56 +02:00
Nicolas Goaziou 4f3b3ce3d9 Fix a docstring
* lisp/org.el (org-get-tag-face): Fix docstring.  Small refactoring.
2015-08-06 14:57:23 +02:00
Nicolas Goaziou 96b4e8f74b org-colview: Preserve face for TODO keywords
* lisp/org-colview.el (org-columns-display-here): Preserve face for TODO
  keywords in column view.

Suggested-by: Matt Price <moptop99@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99557>
2015-08-06 14:55:51 +02:00
Paul Eggert 3a81c7ee6f Backport commit 0c856a2 from Emacs master branch
* lisp/ob-core.el (org-babel-check-evaluate)
(org-babel-confirm-evaluate):
* lisp/ob-fortran.el (org-babel-fortran-var-to-fortran):
* lisp/ox-latex.el (org-latex-compile):
* lisp/ox-man.el (org-man-compile):
* lisp/ox-odt.el (org-odt-template):
* lisp/ox-texinfo.el (org-texinfo-compile):
Change (message (format ...)) to (message ...), and likewise
for ‘error’.  This lessens the probability of confusion when the
output of ‘format’ contains ‘%’.

Fix some confusion with ‘format’
0c856a2c459016f1f9cce173f5b2b49be36e3452
Paul Eggert
Wed Aug 5 19:07:28 2015 -0700
2015-08-05 23:29:43 -04:00
Kyle Meyer 003a0f1069 org-src: Use font-lock-fontify-buffer for blocks
* lisp/org-src.el (org-src-font-lock-fontify-block): Use
  font-lock-fontify-buffer because font-lock-ensure does not display
  source block fonts.

When font-lock-fontify-buffer was originally replaced by
font-lock-ensure, source block fonts were not being displayed, so
99f9999 reverted this change.  However, a backport (d81e6b5) from the
Emacs repo, which was merged to master in 0d0d0ad, reverted this again.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99495>
2015-08-04 23:50:59 -04:00
Paul Eggert ff92583e42 Backport commit eb0f65b from Emacs master branch
Don't overflow if computing approximate percentage
eb0f65b4fbbea60100b53cb40a1d7138d47ad0d2
Paul Eggert
Fri Jul 31 10:13:38 2015 -0700

* lisp/org-list.el (org-update-checkbox-count):
* lisp/org.el (org-table-map-tables)
(org-update-parent-todo-statistics):
Prefer (floor (* 100.0 NUMERATOR) DENOMINATOR) when calculating
progress-report percentages and the like.  This avoids problems
if (* 100 NUMERATOR) would overflow.
* lisp/org-colview.el (org-nofm-to-completion):
Prefer (round (* 100.0 NUMERATOR) DENOMINATOR) to a
more-complicated and less-accurate approximation.
2015-08-04 22:58:47 -04:00
Bastien 0d0d0ad56e Merge branch 'backport-master'
Conflicts:
	lisp/org-table.el
2015-08-05 01:01:46 +02:00
Mitchel Humpherys 99425a46dd contrib: rip out org-jira
Its changelog says it's abandoned, it doesn't really do anything, and it
clashes with [1].  Rip it out.

[1] https://github.com/baohaojun/org-jira
2015-08-05 00:46:43 +02:00
Bastien f246576081 org.el (org-split-string): Tiny refactoring
* org.el (org-split-string): Tiny refactoring.

Thanks to Marcin Borkowski for raising this.
2015-08-04 23:29:37 +02:00
Bastien c6a3749758 org-timer.el (org-timer-set-timer): Don't choke at wrong type
* org-timer.el (org-timer-set-timer): Don't choke at wrong
type for `org-timer-default-timer'.
2015-08-04 22:03:02 +02:00
Bastien 9111c21a75 org.el (org-latex-to-mathml-convert-command): Tiny docstring fix
* org.el (org-latex-to-mathml-convert-command): Tiny docstring fix.
2015-08-04 21:32:30 +02:00
Rasmus af35955781 Fix typo in 6db0b0cd43 2015-08-04 19:19:52 +02:00
Rasmus 6db0b0cd43 ox-html: Respect local values when formatting code
* ox-html.el (org-html-fontify-code): Use local value of
  org-html-htmlize-output-type parent and org-html-htmlize-font-prefix
  parent.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/99450>
2015-08-04 17:55:37 +02:00
Nicolas Goaziou f63d76872c Fix links with newline characters
* lisp/org-element.el (org-element-link-parser): Correctly parse links
  with newline characters.

* lisp/org.el (org-make-link-regexps): Allow newline characters within
  angle links.
(org-activate-angle-links): Support multiline angle links.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
  Update tests.

As a rule of thumb, any newline character and all surrounding
whitespaces are treated as a single space in a bracket link.  They are
removed in angle links.
2015-08-04 16:40:25 +02:00
Nicolas Goaziou 02532389f4 Fix priority for fuzzy searches
* lisp/org.el (org-link-search): If fuzzy search is not starred, prefer
  targets and named elements over headlines.
2015-08-04 14:41:51 +02:00
Nicolas Goaziou 776449fd7d Prevent duplicating calls to `org-link-search'
* lisp/org.el (org-open-at-point): Do not call twice `org-link-search'
  when destination is not accessible within the current narrowed part of
  the buffer.
2015-08-04 14:32:55 +02:00
Nicolas Goaziou b4d85b47a9 Remove spurious argument to `org-link-search'
* lisp/org.el (org-link-search): Remove TYPE argument, used to force
  `org-occur' or `org-do-occur' on fuzzy search.  Instead, enclose string
  within forward slashes.

* lisp/org-macro.el (org-macro-initialize-templates):
* lisp/ob-exp.el (org-link-search): Apply signature change.
2015-08-04 14:10:44 +02:00
Nicolas Goaziou 271ecd090a Small refactoring
* lisp/org.el (org-set-tags): Small refactoring.
2015-08-04 11:01:33 +02:00
Nicolas Goaziou a70604eb63 org-table: Fix computation with backwards ranges
* lisp/org-table.el (org-table-get-range): Use correct values to extract
  range.  This is important when range is defined backwards (e.g.,
  @-I..@-II).

Reported-by: Sebastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/99430>
2015-08-03 22:58:39 +02:00
Nicolas Goaziou a3b2b7473e Repair radio target search
* lisp/org.el (org-open-at-point): Find radio targets again.
(org-search-radio-target): New function.

* testing/lisp/test-org.el (test-org/open-at-point/radio-target): New
  test.
2015-08-03 02:59:13 +02:00
Nicolas Goaziou e50033d494 Prevent fuzzy links from matching themselves
* lisp/org.el (org-open-at-point):
(org-link-search): Prevent fuzzy links from matching themselves.
2015-08-03 02:20:06 +02:00
Nicolas Goaziou cfe5bc97f8 Fix link search
* lisp/org.el (org-open-link-marker): Remove variable.
(org-open-at-point): Apply removal.
(org-link-search): Sanitize function.  Fix issue with internal link
encoding.
(org-search-not-self): Remove function.

* lisp/ox.el (org-export--inclusion-absolute-lines): Ensure INCLUDE
  keywords with locations can find named elements and targets.

* testing/lisp/test-org.el (test-org/return):
(test-org/coderef):
(test-org/custom-id): Update tests.
(test-org/fuzzy-links): Add tests.

Reported-by: Ivanov Dmitry <usr345@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99340>
2015-08-03 01:06:32 +02:00
Nicolas Goaziou 8094d01a68 org-table: Simplify `org-table-sort-lines'
* lisp/org-table.el (org-table-sort-lines): Rely on `sort-subr'.
  Refactor code.
(org-table--do-sort): Remove function.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): Fix test.
2015-08-02 18:01:15 +02:00
Nicolas Goaziou 14d07c0e7d org-table: Improve tables' speed in large buffers
* lisp/org-table.el (org-table-auto-recalculate-regexp):
(org-table-recalculate-regexp):
(org-table-calculate-mark-regexp):
(org-table-column-names):
(org-table-column-name-regexp):
(org-table-local-parameters):
(org-table-named-field-locations):
(org-table-current-line-types):
(org-table-current-begin-pos):
(org-table-current-ncol):
(org-table-dlines):
(org-table-hlines): Improve docstrings.

(org-table-current-begin-line): Remove variable.

(org-table-save-field): New macro.

(org-table-get-specials): Remove function.
(org-table-analyze): New function, renamed from
`org-table-get-specials'.

(org-table-find-row-type): Remove function.
(org-table--row-type): New function, renamed from
`org-table-find-row-type'.

(org-table-align): Use new macro.

(org-table-field-info):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-sort-lines):
(org-table-paste-rectangle):
(org-table-wrap-region):
(org-table-current-field-formula):
(org-table-get-formula):
(org-table-maybe-recalculate-line):
(org-table-eval-formula):
(org-table-get-range):
(org-table--descriptor-line):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-edit-formulas):
(org-table-show-reference):
(org-table-get-remote-range): Apply changes above.  Refactor code.

(org-table-check-inside-data-field):
(org-table-current-column):
(org-table-current-dline):
(org-table-line-to-dline):
(org-table-copy-region):
(org-table-rotate-recalc-marks):
(org-table-fedit-post-command):
(org-table-fedit-convert-buffer):
(org-table-highlight-rectangle): Refactor code.

(org-table-goto-field): New function.

* lisp/org-capture.el (org-capture-place-table-line): Apply change made
  to table internals.

The point of this commit is to remove dependency on `org-current-line'
and `org-goto-line', which are both expensive in large buffers.  Now,
lines are relative to the beginning of the current table instead of
global (i.e., relative to the beginning of the buffer).
2015-08-02 18:01:12 +02:00
Nicolas Goaziou 8344f29dac org-table: Speed-up `org-table-{begin,end}'
* lisp/org-table.el (org-table-border-regexp): Improve docstring.
(org-table-begin):
(org-table-end): Assume point is in a table already.  In this case,
using parser is not necessary anymore.
2015-08-02 17:56:13 +02:00
Nicolas Goaziou 57883f7957 Fix org-at-TBLFM-p
* lisp/org.el (org-at-TBLFM-p): Make sure match is case-insensitive.
  Improve speed in the general case.
2015-08-02 17:56:12 +02:00
Nicolas Goaziou 84d5986cdf org-table: Fix code comments 2015-08-02 17:56:12 +02:00
Nicolas Goaziou 00170d401f org-table: Remove outdated functions
* lisp/org-table.el (org-table-colgroup-line-p,
  org-table-cookie-line-p): Remove functions.

* etc/ORG-NEWS: Signal removal.

These functions were used in the pre Org 8.0, specifically in HTML
export back-end.  They are no longer accurate since they tolerate some
HTML entities whereas Org syntax doesn't.
2015-08-02 17:55:55 +02:00
Nicolas Goaziou 4117e398e6 ox-latex: Tiny refactoring
* lisp/ox-latex.el (org-latex-guess-polyglossia-language): Tiny
  reactoring.
2015-08-02 09:50:45 +02:00
Rasmus 8d3bc7875f ox-latex: New function to generate header
* ox-latex.el (org-latex--make-header): New function.
  (org-latex-template): Use new function.
* ox-koma-letter.el (org-koma-letter-template): Use new function.
2015-07-31 14:12:50 +02:00
Rasmus 309f15887a Add notes on Polyglossia support
* ox-latex.el (org-latex-classes): Update docstring.
* ORG-NEWS: Update.
2015-07-31 14:12:35 +02:00
Rasmus 3f03986bb2 ox-latex: Add polyglossia support
* ox-latex.el (org-latex-guess-polyglossia-language): New function.
  (org-latex-polyglossia-language-alist): New defconst.
  (org-latex-template): Apply new function.
* ox-koma-letter.el (org-koma-letter-template): Apply new function.

Suggested-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98921>
2015-07-29 18:17:36 +02:00
Oleh Krehel 00142f4edf lisp/org.el (org-set-tags): Simplify further
* lisp/org.el (org-set-tags): Use let* for c0 p0 c1 rpl di tc;
Restructure so that no check on c0 is needed; Don't return a useless
tags var from cond; Change and into an equivalent when.
2015-07-28 15:16:49 +02:00
Oleh Krehel ceae5d651b lisp/org.el (org-set-tags): Simplify the code
* lisp/org.el (org-set-tags): Prefer let* to multi-variable setq,
move c0 p0 c1 rpl di tc variables to a narrower let scope.
2015-07-28 15:06:25 +02:00
Kyle Meyer 6f9184a294 Merge branch 'maint' into backport-master 2015-07-26 23:56:50 -04:00
Paul Eggert fa1a61c2ef Backport commit 85aa6ed from Emacs master branch
Use \r rather than ^M in string literals
85aa6ede9fe1b8165a99a4046dd8262ec93a02d5
Paul Eggert
Sat May 30 09:44:38 2015 -0700
2015-07-26 23:29:32 -04:00
Paul Eggert 6df6806311 Backport commit dfc2ef1 from Emacs master branch
Fix minor quoting problems in doc strings
dfc2ef11a84d33eab916ff87b8537f8e28c05c92
Paul Eggert
Thu May 28 00:22:03 2015 -0700
2015-07-26 23:29:31 -04:00
Paul Eggert 6b04312e85 Backport commit 96794d2 from Emacs master branch
Don't quote nil and t in doc strings
96794d2f97cd064e4c2bf4f71459b42558cc8c79
Paul Eggert
Thu May 21 10:06:44 2015 -0700
2015-07-26 23:29:31 -04:00
Paul Eggert 9dcbe163cc Backport commit 9d35bb8 from Emacs master branch
* lisp/org-compat.el (org-number-sequence):
* lisp/org.el (org-remove-highlights-with-change)
(org-structure-template-alist):
* lisp/ox-html.el (org-html-link-org-files-as-html):
Fix minor quoting problems in doc strings, e.g., missing quote,
``x'' where `x' was meant, etc.

Fix minor quoting problems in doc strings
9d35bb8d6518bb913ab08bace2af08963c003177
Paul Eggert
Tue May 19 15:01:16 2015 -0700
2015-07-26 23:29:31 -04:00
Stefan Monnier c6164293fc Backport commit c9a75a4 from Emacs master branch
* lisp/org.el (org-insert-heading, org-sort-entries):
* lisp/org-mouse.el (org-mouse-end-headline)
(org-mouse-context-menu):
* lisp/org-clock.el (org-clock-cancel):
Add explicit second arg to looking-back.

Fix byte-compiler warnings about looking-back.
c9a75a4030a556d700fd95222ec0bf4c1a9f67b5
Stefan Monnier
Mon Apr 20 21:55:00 2015 -0400
2015-07-26 23:29:31 -04:00
Paul Eggert 0cec91d039 Backport commit b884ff3 from Emacs master branch
Spelling fix for 'hfy-optimizations'
b884ff380dc341ca8dc8fcfe4357110e191216ce
Paul Eggert
Sun Apr 5 23:43:22 2015 -0700
2015-07-26 23:29:31 -04:00
Dmitry Antipov d77b7c6c7b Backport commit 9c3883b from Emacs master branch
* lisp/org-mouse.el (org-mouse-do-remotely): Prefer point-marker to
  copy-marker of point.
* lisp/ob-core.el (org-babel-insert-result): Prefer point-min-marker and
  point-max-marker.

Conflicts:
  lisp/org-mouse.el
2015-07-26 23:29:30 -04:00
Kyle Meyer c115c7b4e8 org-compat: Use different font-lock-ensure alias
* lisp/org-compat.el (org-font-lock-ensure): Remove in favor of
  font-lock-ensure alias from dcbaebc.

Instead of org-font-lock-ensure alias introduced in dcbaebc ("Backport
commit 6711a21 from Emacs master branch", 2014-05-28), use
font-lock-ensure alias added in e6883dd ("org-compat: Provide
compatibility definition for font-lock-ensure", 2014-06-01).
2015-07-26 23:29:14 -04:00
Stefan Monnier d81e6b52b7 Backport commit 6711a21 from Emacs master branch
* lisp/org-compat.el (org-font-lock-ensure): New function.
* lisp/ox-odt.el (org-odt-do-format-code):
* lisp/ox-html.el (org-html-fontify-code):
* lisp/org.el (org-fontify-like-in-org-mode):
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/ox-org.el (org-org-publish-to-org):
Use it. Avoid using find-file from Elisp.

6711a21f1125c0047c56eb266eb374c1ec90a967
Stefan Monnier
Wed May 28 23:45:29 2014 -0400
2015-07-26 23:28:25 -04:00
Paul Eggert a55b5a4269 Backport commit f9acac7 from Emacs master branch
* lisp/org-clock.el (org-clock-save):
Prefer (system-name) to system-name, and avoid naming
locals 'system-name'.

system-name's returned value can vary
f9acac751d4cd22480e62cc63936b1208ca9fe48
Paul Eggert
Mon Dec 29 12:38:58 2014 -0800
2015-07-26 23:28:25 -04:00
Paul Eggert 72416b82ac Backport commit 7aa506e from Emacs master branch
Spelling fixes
7aa506eed8881788485a9774165454404bac2623
Paul Eggert
Thu Dec 25 18:08:47 2014 -0800
2015-07-26 23:28:25 -04:00
Paul Eggert 81272053cd Backport commit 3de474e from Emacs master branch
Spelling fixes
3de474e4ac7418d06b9f37489f939a16d9bde1c2
Paul Eggert
Sat Dec 13 23:41:33 2014 -0800
2015-07-26 23:28:25 -04:00
Paul Eggert bfbc2bb304 Backport commit cc857dd from Emacs master branch
Fix misspellings like "an unibyte buffer"
cc857dd0db0fad257747134bdbd8318a21d12cab
Paul Eggert
Tue Dec 9 16:27:23 2014 -0800
2015-07-26 23:28:24 -04:00
Paul Eggert 6873c9088b Backport commit 78d45b6 from Emacs master branch
* lisp/org-compat.el (org-float-time):
Use 2-arg defalias, since XEmacs 21.4 doesn't support 3-arg.

Port current-time change to XEmacs 21.4.
78d45b66d41859ab9bdd571fea18fc06a7670911
Paul Eggert
Tue Oct 28 20:21:06 2014 -0700
2015-07-26 23:28:24 -04:00
Kyle Meyer 5a01b116a4 Pass current-time as optional arg for tests
* lisp/org.el (org-read-date-analyze):
* lisp/org-timer.el (org-timer-seconds): Explicitly pass current-time as
  optional time argument and explain reason in comment.

This reverts some changes from 91ab6c4 ("Backport commit 123ddec from
Emacs master branch", 2014-10-28).
2015-07-26 23:28:09 -04:00
Paul Eggert 217ad4aafb Backport commit 123ddec from Emacs master branch
* doc/org.texi (Dynamic blocks):
* lisp/org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling):
* lisp/org-clock.el (org-resolve-clocks, org-clock-get-sum-start)
(org-clock-special-range):
* lisp/org-timer.el (org-timer-seconds):
* lisp/org.el (org-read-date-analyze, org-get-cursor-date):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-icalendar.el (org-icalendar--vtodo):
Omit unnecessary call to current-time.
* lisp/org.el (org-get-cursor-date):
Don't call current-time twice to get the current time stamp,
as this can lead to inconsistent results.
* lisp/org-compat.el (org-float-time):
Simplify to an alias because time-to-seconds now behaves like float-time
with respect to nil arg.
* lisp/org-clock.el (org-clock-get-table-data): Omit unnecessary, lossy
conversion from floating point to Emacs time and back.
(org-resolve-clocks): Prefer two-argument floor.

Simplify use of current-time and friends.
123ddec7f807f4bd7400bbbe08219afb02269c00
Paul Eggert
Tue Oct 28 18:42:51 2014 -0700
2015-07-26 23:25:11 -04:00
Ruben Maher eccd704aea ox.el: Remove docstring for nonexistent argument
* lisp/ox.el (org-export-output-file-name): Remove docstring for
  nonexistent argument VISIBLE-ONLY.
2015-07-25 14:17:49 +02:00
Nicolas Goaziou bf37cd09b1 org-table: Do not trim output of radio tables
* lisp/org-table.el (orgtbl-to-generic): Leading and trailing spaces
  could be significant, so do not trim result.  However, remove the
  final newline character.

Reported-by: lom pik <lompikvoila@gmail.com> <>
<http://permalink.gmane.org/gmane.emacs.orgmode/99171>
2015-07-23 00:34:02 +02:00
Nicolas Goaziou 6e1d7bc8fe Fix `org-beginning-of-line'
* lisp/org.el (org-beginning-of-line): Prevent an error when buffer
  contains only a single star.

* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.
2015-07-22 09:39:07 +02:00
Nicolas Goaziou 985420eceb Speed improvement for `org-goto'
* lisp/org.el (org-goto-local-search-headings): Do not rely on
  `org-context' just to check if point is on a headline but not on its
  tags.

Reported-by: Gregor Zattler <telegraph@gmx.net> <w>
<http://permalink.gmane.org/gmane.emacs.orgmode/99111>
2015-07-20 11:40:44 +02:00
Rasmus 216a53d6cc ox-html: Better customize for org-html-viewport
* ox-html.el (org-html-viewport): Allow disabling via customize.
2015-07-20 10:40:26 +02:00
Nicolas Goaziou cf5cb15743 org-colview: Do not silently modify buffer
* lisp/org-colview.el (org-columns-display-here): Do not modify buffer
  silently.  Small refactoring.

Reported-by: Nicolas Richard <youngfrog@members.fsf.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/98992>
2015-07-18 09:39:23 +02:00
Kyle Meyer ed6349d28c org-closest-date: Don't accept canceled repeater
* lisp/org.el (org-time-string-to-absolute): Don't pass a canceled
  repeater to org-closest-date.
  (org-closest-date): Raise an error when passed a canceled repeater.

Prevent arith-error from occurring when a canceled repeater is passed to
org-closest-date.
2015-07-16 11:44:02 +02:00
Rasmus 20795fd1c4 org-entities: Add frowny
* org-entities.el (org-entities): Add frowny.
2015-07-13 11:40:29 +02:00
Rasmus 77ab3c90d5 org-entities: Change smile and frown
* org-entities.el (org-entities): Reinterpret smile and frown entities.

See: https://en.wikipedia.org/wiki/Cap_product,
     https://en.wikipedia.org/wiki/Cup_product
2015-07-13 11:40:29 +02:00
Rasmus 788d15e469 org.el: Remove wasysym LaTeX dependency 2015-07-13 11:36:25 +02:00
Rasmus 10b424dd63 org.el: Remove marvosym LaTeX dependency
* org.el (org-latex-default-packages-alist): Remove marvosym.
* org-entities.el (org-entities): \EUR is now replaced with
  \texteuro.  Remove EURdig, EURhv, EURcr, EURtm.
2015-07-13 11:36:25 +02:00
Rasmus 384bc2d200 org.el: Remove default LaTeX tolerance
* org.el (org-latex-default-packages-alist): Remove fixed tolerance.
2015-07-13 11:36:25 +02:00
Rasmus fd990a81e3 ox-html: Change footpara wrapper
* ox-html.el (org-html-footnote-section): Wrap footnote definitions
  content in a div rather than a p.  p is a bad element to use for a
  wrapper as it can neither contain other p elements nor tables.
  (org-html-style-default): Change .footpara to inline display style.

Reported-by: OSiUX <xuiso@osiux.com.ar>
<http://permalink.gmane.org/gmane.emacs.orgmode/98984>
2015-07-13 11:36:25 +02:00
Nicolas Goaziou 120dcd1d13 org-table: Fix table alignment
* lisp/org-table.el (org-table-align): Refactor function fix wrong
  alignment bug.
* lisp/org-compat.el (org-format-transports-properties-p): Remove
  variable.
* testing/lisp/test-org.el (test-org/fill-paragraph): Fix test

Reported-by: William Denton <wtd@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98901>
2015-07-09 17:53:33 +02:00
Rasmus be019c4339 Autoload orgtbl-exp-regexp
* org-table.el (orgtbl-exp-regexp): Add autoload cookie.

Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/98887>
2015-07-07 14:42:31 +02:00
Nicolas Goaziou c76fef6b9d org-clock: Add `untilnow' time block
* lisp/org-clock.el (org-clock-special-range): Handle `untilnow'
  range.
(org-clock--oldest-date): New variable.
(org-clock-display-default-range): Add `untilnow' as valid range.  Use
new variable.
(org-clock-display): Offer `untilnow' as a possible range.

* doc/org.texi (The clock table): Document `untilnow'

* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents-at-point): Fix test
when called interactively.
(test-org-clock/clocktable):
(test-org-clock/clocktable1): Update tests.
(test-org-clock/clocktable-until-now): New test.

* etc/ORG-NEWS (title): Document new feature.

Suggested-by: Sébastien Vauban
2015-07-04 14:31:34 +02:00
Marco Wahl 5a3ab2a7fd Fix message text in `org-toggle-sticky-agenda'
* org-agenda.el (org-toggle-sticky-agenda): Dropped the irritating 'was'
  from the message.
2015-07-04 09:37:16 +02:00
Nicolas Goaziou 747fefe2b0 Update keywords for defcustom `org-latex-default-packages-alist'
* lisp/org.el (org-latex-default-packages-alist): Update keywords to
  reflect changes to default value in
  5e03133c47.
2015-07-03 21:20:53 +02:00
Nicolas Goaziou 048f0e1a82 ob-shell: Add missing "sh" to "shell" conversions
* lisp/ob-shell.el (org-babel-default-header-args:shell): Renamed from
`org-babel-default-header-args:sh'.
(org-babel-variable-assignments:shell): Renamed from
`org-babel-variable-assignments:sh'.
(org-babel-prep-session:shell): Renamed from
`org-babel-prep-session:sh'.  Apply renaming.
(org-babel-load-session:shell): Renamed from
`org-babel-load-session:sh'.  Apply renaming.

(org-babel-execute:shell): Apply renaming.

Reported-by: Sebastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/98859>
2015-07-03 16:17:11 +02:00
Nicolas Goaziou 188bae903f Fix property inheritance with extended values
* lisp/org.el (org-property--local-values): New function.
(org-entry-get): Use new function.  Ignore global values when there is
no inheritance.
(org-entry-get-with-inheritance): Fix extended values, which do not
stop anymore inheritance search.

* testing/lisp/test-org.el (test-org/entry-get): Add tests.
2015-07-03 15:34:47 +02:00
Rasmus 5e03133c47 Remove float from org-latex-default-packages-alist 2015-07-03 13:42:21 +01:00
Rasmus c4a913770d Update minted documentation.
* ox-latex.el (org-latex-listings):
* org.texi (Literal examples): Update minted documentation.
2015-07-03 13:42:21 +01:00
Rasmus 46a71bb93f ox-latex: Support captions for none-floats
* ox-latex.el (org-latex--caption/label-string): Format
  nonfloating captions using the capt-of package.
  (org-latex--inline-image, org-latex-src-block)
  (org-latex--org-table): Allow none-float and caption.
2015-07-03 13:42:03 +01:00
Nicolas Goaziou 1221715a74 org-element: Fix parsing recursive babel calls
* lisp/org-element.el (org-element-babel-call-parser): Fix parsing
  recursive babel calls.

* testing/lisp/test-org-element.el (test-org-element/babel-call-parser): Add test.
2015-07-03 00:33:45 +02:00
Nicolas Goaziou e61bedadcb ox-html: Prefer custom ID for links in table of contents
* lisp/ox-html.el (org-html--format-toc-headline): Use custom ID when
  available.

Reported-by: Mitchel Humpherys <mitch.special@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98797>
2015-07-01 14:49:42 +02:00
Nicolas Goaziou 304f84530b Use inactive timestamps when re-scheduling or re-deadlining
* lisp/org.el (org-log-note-headings): Improve docstring.
(org-store-log-note): When re-scheduling or re-deadlining, convert old
or new timestamp to an inactive one so as to not clutter the agenda.

Reported-by:  Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/93498>
2015-06-29 22:19:38 +02:00
Nicolas Goaziou cedef74216 org-element: Minimize false positives when matching a table.el table
* lisp/org-element.el (org-element--set-regexps): Improve regexp for
  table.el tables.
2015-06-29 14:49:00 +02:00
Nicolas Goaziou 1cc8cdc49e Be more strict when matching an Org table
* lisp/org.el (org-at-table-p): Do not allow "+" character at the
  beginning of a table row.
2015-06-28 23:32:38 +02:00
Nicolas Goaziou 157591db7c Fix `org-decrease-number-at-point'
* lisp/org.el (org-decrease-number-at-point): Handle the case when INC
  is nil.
2015-06-28 21:09:59 +02:00
Nicolas Goaziou 106ca75307 org-element: Fix table and table.el mix
* lisp/org-element.el (org-element-table-parser): Properly parse an
  Org table followed by a line starting with a "+".

* testing/lisp/test-org-element.el (test-org-element/context): Fix
  test.
2015-06-28 21:09:16 +02:00
Nicolas Goaziou f03d96572e Silence byte-compiler 2015-06-28 16:50:08 +02:00
Nicolas Goaziou 6d60138260 org-table: Do not modify buffer needlessly when aligning table
* lisp/org-table.el (org-table-align): Compare new table with old one
  before replacing it.  Only replace modified lines.
2015-06-28 16:21:45 +02:00
Nicolas Goaziou 03eb88661b Use parser for `org-at-table-p' and al.
* lisp/org-table.el (org-table-begin):
(org-table-end): Refactor using parser.

* lisp/org.el (org-at-table-p):
(org-at-table.el-p): Refactor using parser.

(org-meta-return): Use `org-at-table-p'.

(org-at-table-hline-p):
(org-table-recognize-table.el): Small refactoring.
2015-06-28 14:51:31 +02:00
Nicolas Goaziou aa9c4bfb6f org-element: Remove dependency on `org-at-table-p'
* lisp/org-element.el (org-element-table-parser): Do not call
  `org-at-table.el-p'.
(org-element--current-element): Do not call `org-at-table-p'.
2015-06-28 11:37:13 +02:00
Nicolas Goaziou c916ea54f0 org-table: Remove `org-table-relative-ref-may-cross-hline'
* lisp/org-table.el (org-table-relative-ref-may-cross-hline): Remove
  variable.

* etc/ORG-NEWS: Document removal.

This variable was declared obsolete in August 2009.  See
2cc99fbb0a.
2015-06-28 10:34:31 +02:00
Sergey Gordienko c15db80e32 org-mobile: Tiny fix in creating index.org file
* lisp/org-mobile.el (org-mobile-create-index-file):
Eliminate cloning of `#+READONLY' property in the `index.org' file.
A sublists of `org-todo-keywords' don't need to contain the `|'.

TINYCHANGE
2015-06-28 09:06:00 +02:00
Kyle Meyer 5f3d8037a5 org-add-planning-info: Improve deletion handling
* lisp/org.el (org-add-planning-info): Reset point before each
  planning entry search.  Clean up extra spaces.

* testing/lisp/test-org.el (test-org/add-planning-info): Add tests.

- Reposition save-excursion call to reset point every dolist
  iteration.  Otherwise, the order of the entries to be removed
  matters, and a call like

      (org-add-planning-info nil nil 'scheduled 'deadline)

  on

      DEADLINE: <2015-06-26 Fri> SCHEDULED: <2015-06-26 Fri>

  will fail to remove the deadline entry.

- Delete leading white space even when at the beginning of the line so
  that, when org-adapt-indentation is nil, a space is not inserted
  when removing the leading planning info entry.

  This prevents headings with repeating entries like

      SCHEDULED: <2015-06-26 Fri +1w>

  from being closed and recycled with an extra space in front of
  SCHEDULED.

- Add leading white space to the planning info entry regexp to prevent
  leftover white space when removing entries other than the first
  entry.
2015-06-28 09:03:46 +02:00
Nicolas Goaziou 5a5e4a5eee ox-latex: Fix backslash escaping in plain text
* lisp/ox-latex.el (org-latex-plain-text): Fix backslash escaping.
2015-06-26 09:50:22 +02:00
Nicolas Goaziou a833d35159 ox: Properly fix internal regexps after each buffer change
* lisp/ox.el (org-export-as): Refresh regexps before executing Babel
  code, running last hook and parsing buffer so precomputed regular
  expressions are correct at each of these steps.

This is not necessary before macros since those are not expected to
rely on computed expression.  Actually, advanced macros, i.e. with
"(eval ...)" syntax, could make use of them, but a Babel snippet is
more likely in this situation.

Reported-by: Robert Klein <RoKlein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/98550>
2015-06-25 15:09:20 +02:00
Eric S Fraga 0b0bbf6194 org-capture: Place capture buffer in other window
* org-capture.el (org-capture-fill-template): The capture template
  buffer will be displayed in another window, keeping original window
  visible if appropriate.
2015-06-25 14:21:56 +02:00
Grégoire Jadi 70bfa4027b lisp/org-agenda.el: Fix non-persistent category filters in sticky agenda
* lisp/org-agenda.el (org-agenda-prepare): Use the correct key for
  category filter.

`org-agenda-prepare-window' uses 'cat whereas `org-agenda-prepare' used 'car.
2015-06-24 09:51:39 +02:00
Grégoire Jadi e1e3b83b2b lisp/org-agenda.el: Fix non-persistent filters when refreshing sticky agenda
* lisp/org-agenda.el (org-agenda-prepare): Fix non-persistent filters when refreshing sticky agenda

When a sticky agenda is buried, then reviving and refreshing, existing
filters are ignored even when org-agenda-persistent-filter is `t'.

Reported and fixed by Daniel Borchmann
2015-06-24 09:51:34 +02:00
Nicolas Goaziou b07bd32081 ox: Handle subtree properties referring to multiple options
* lisp/ox.el (org-export--get-subtree-options): When multiple options
  refer to the same keyword, and, as a consequence, to the same export
  property, make sure all of them get updated.
* testing/lisp/test-ox.el (test-org-export/get-subtree-options): Add
  test.

Reported-by: Myles English <mylesenglish@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98583>
2015-06-23 22:09:43 +02:00
Nicolas Goaziou 66686f69a5 ox-latex: Remove useless call to `org-latex--wrap-latex-math-block'
* lisp/ox-latex.el (org-latex-footnote-reference): Remove call to
  `org-latex--wrap-latex-math-block' since definitions are already
  taken care of at the filter parse tree level, since
  47265b31ca.
2015-06-23 15:31:09 +02:00
Nicolas Goaziou 47265b31ca ox: Add external footnotes definitions in parse tree
* lisp/ox.el (org-export-get-environment):
(org-export-collect-tree-properties):
Remove :footnote-definition-alist property.
(org-export-get-footnote-definition): Apply removal of property.

(org-export--merge-external-footnote-definitions): New function.
(org-export-as): Use new function.

* testing/lisp/test-ox.el (test-org-export/footnotes): Update tests.

This change allows to have all footnote definitions within the parse
tree, so they can be reached with, e.g., a parse tree filter.
2015-06-23 15:28:01 +02:00
Nicolas Goaziou 7ee2d93122 org-element: Implement `org-element-create'
* lisp/org-element.el (org-element-create): New function.
(org-element-adopt-elements): Small refactoring.
2015-06-23 15:22:03 +02:00
Nicolas Goaziou 8ff31bd0cf ox-latex: Introduce :environment attribute for example blocks
* lisp/ox-latex.el (org-latex-example-block): Implement :environment
  attribute, which allows to override "verbatim" environment.
* doc/org.texi (@LaTeX{} specific attributes): Document change.
2015-06-23 08:43:07 +02:00
Kyle Meyer 329683861c org-clone-subtree-with-time-shift: Accept 0 clones
* lisp/org.el (org-clone-subtree-with-time-shift): Allow argument
  specifying number of clones to be 0.

* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
  tests.

This makes it possible to clone a subtree with a repeating timestamp
so that the repeater is removed from the original subtree and a single
shifted, repeating clone is created.  If the original subtree does not
have a repeating timestamp, no clones will be made.
2015-06-22 21:49:52 +02:00
Nicolas Goaziou 739853d128 Tiny speed-up for `org-entry-properties'
* lisp/org.el (org-entry-properties): Tiny speed-up.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.
2015-06-22 10:01:51 +02:00
Nicolas Goaziou e6f36cfe3a ox: Tiny refactoring
* lisp/ox.el (org-export-replace-region-by): Refactor.
2015-06-18 15:21:02 +02:00
Nicolas Goaziou e900ebed08 ob-core: Small refactoring
* lisp/ob-core.el (org-babel-params-from-properties): Refactor code to
  avoid nesting `mapcar' calls.
2015-06-17 11:55:57 +02:00
Nicolas Goaziou d1f9aa3a02 ox: Simplify fuzzy link matching
* lisp/ox.el (org-export-resolve-fuzzy-link): When a fuzzy link
  matches more than one headline, prefer the first one in the parse
  tree.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Remove a test.

This behaviour is consistent with `org-open-at-point'.  Also, it
allows to cache destinations.
2015-06-16 23:24:42 +02:00
Nicolas Goaziou 2c27e85f11 Sanitize link encoding
* lisp/org.el (org-store-link): Improve docstring.
(org-make-link-string): Escape internal links only when absolutely
necessary.
(org-link-escape-chars): Add percent character.
(org-link-escape-chars-browser): Make space character more visible.
(org-link-escape): Refactor code.
(org-display-inline-images): Properly unescape path before creating
the link.
(org-extract-attributes): Remove function.

* lisp/ox.el (org-export-resolve-fuzzy-link): Decode path before
  resolving link.

* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Add
  test.
2015-06-16 23:24:38 +02:00
Suvayu Ali 2cddb905a4 ox-beamer: Wrap labels in braces
* ox-beamer.el (org-beamer--get-label): Wrap labels in braces.

The colon in the label name causes an argument parsing problem, for
more see <http://tex.stackexchange.com/q/250640/4416>.
2015-06-16 21:30:41 +02:00
Nicolas Goaziou aea374680c Small refactoring
* lisp/org.el (org-link-unescape): Refactor code.
2015-06-16 16:53:46 +02:00
Nicolas Goaziou cf5fd31f0c ox-beamer: Add %R and %O placeholders for extra environments
* lisp/ox-beamer.el (org-beamer-environments-extra): Handle "%R" and
  "%O" placeholders.
(org-beamer--format-block): Fill template with appropriate values for
placeholders above.

Suggested-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98361>
2015-06-16 15:26:47 +02:00
Nicolas Goaziou a02b672f93 ox-beamer: Fix labels to headlines
* lisp/ox-beamer.el (org-beamer--get-label): Use headline's internal
  reference instead of using numbers.
2015-06-16 14:04:53 +02:00
Nicolas Goaziou 626caa4e9e ob-tangle: Silence byte-compiler 2015-06-16 00:09:20 +02:00
Nicolas Goaziou 90df55ea7b ob-tangle: Small refactoring
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Refactor.
2015-06-15 21:38:14 +02:00
Nicolas Goaziou 182ff104b7 org-element: Fix cache bug for orphaned elements
* lisp/org-element.el (org-element--cache-sync-requests): Remove a now
  useless element from requests
(org-element--cache-submit-request): Apply change to sync request.
(org-element--cache-process-request): Apply change to sync requests.
Fix removal of orphaned elements, i.e., elements not affected by
a change, but with an ancestor that was.

* testing/lisp/test-org-element.el (test-org-element/cache): Add test.

Reported-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98260>
2015-06-14 14:52:04 +02:00
Nicolas Goaziou b856f66892 ox-html: Prefer custom ID over internal references for links to headlines
* lisp/ox-html.el (org-html-link): Use custom ID if present instead of
  internal reference.

Reported-by: Oleh Krehel <ohwoeowho@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98259>
2015-06-10 13:31:16 +02:00
Arun Persaud e453a261a7 ox-html: Reorder output of meta data in head
* lisp/ox-html.el (org-html--build-meta-info): Charset and viewport
  meta data should come first in `head'.  Only reordered output, no
  other code changes.

See, for example:
  - https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute
  - http://getbootstrap.com/getting-started/#template

TINYCHANGE
2015-06-09 21:06:49 +02:00
Nicolas Goaziou 145ac49faf org-list: Silence byte-compiler 2015-06-09 17:14:13 +02:00
Nicolas Goaziou a4cc9d82d8 org-list: Fix checkbox update with inlinetasks
* lisp/org-list.el (org-update-checkbox-count): Change algorithm.  Use
  Element parser.

* testing/lisp/test-org-list.el (test-org-list/update-checkbox-count):
  New test.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/97594>
2015-06-09 17:06:17 +02:00
Nicolas Goaziou 2e5981e003 org-element: Fix structure for list elements containing a drawer
* lisp/org-element.el (org-element--list-struct): Fix return value
  when a drawer is found within an item.
2015-06-09 17:05:21 +02:00
Nicolas Goaziou 3924989b4f org-table: Fix formulas with relative ranges in current row
* lisp/org-table.el (org-table-eval-formula): Fix formulas with
  relative ranges in current row.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/97727>
2015-06-09 15:03:27 +02:00
Nicolas Goaziou c532ff36aa ox-latex: Fix b8ade2e79e
* lisp/ox-latex.el (org-latex-inline-src-block): Fix
  b8ade2e79e.
2015-06-07 15:18:38 +02:00
Nicolas Goaziou b8ade2e79e ox-latex: Do not use \verb command anymore
* lisp/ox-latex.el (org-latex-text-markup-alist): Remove \verb from
  default value.
(org-latex--protect-text): New function.
(org-latex--text-markup):
(org-latex-inline-src-block): Use new function.

Suggested-by: Titus von der Malsburg <malsburg@posteo.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/98000>
2015-06-07 01:13:51 +02:00
Nicolas Goaziou 50ba0a5ed6 Fix 1a73641770
* lisp/org.el (org-icompleting-read): Let `completing-read' or
  equivalent sort out type of completion.
(org-olpath-completing-read): Revert partially
1a73641770.
2015-06-07 00:38:58 +02:00
Nicolas Goaziou 9fd317b1b0 Fix logging in indirect buffers
* lisp/org.el (org-store-log-note): Ensure insertion point is
  available in the narrowed part of the current buffer.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98152>
2015-06-06 09:08:46 +02:00
Nicolas Goaziou 9540ff8d7a Revert "ox-html.el (org-html-fontify-code): Possibly deactivate fci-mode"
This reverts commit 44aaaad8c0.

See <http://permalink.gmane.org/gmane.emacs.orgmode/98153>.
2015-06-05 09:00:39 +02:00
Brice Waegeneire 93cc5fb517 org-timer.el: hh:mm:ss format for setting a timer
* lisp/org-timer.el (org-timer-set-timer): Add support for hh:mm:ss
format.
(org-timer-default-timer): Type changed from number to string.
* testing/lisp/test-org-timer.el (test-org-timer/set-timer): Add
hh:mm:ss format in the test.
2015-06-02 23:18:13 +02:00
Nicolas Goaziou 03936a50f4 org-colview: Tiny speed-up
* lisp/org-colview.el (org-columns): Use buffer position instead of
  line number.
2015-06-02 22:01:06 +02:00
Nicolas Goaziou f1ee487218 org-colview: Handle user-defined inheritance in agenda colview
* lisp/org-colview.el (org-agenda-columns): Use `org-entry-get'
  instead of `org-entry-properties' to handle inheritance for
  user-provided properties.
2015-06-02 21:56:50 +02:00
Nicolas Goaziou 80aa84f135 org-colview: Update docstring
* lisp/org-colview.el (org-columns-compile-format): Update docstring.
2015-06-02 21:14:55 +02:00
Nicolas Goaziou f91d194d4f org-src: Fix `org-(un)escape-code-in-region'
* lisp/org-src.el (org-escape-code-in-region):
(org-unescape-code-in-region): Fix functions.

Reported-by: Daimrod <daimrod@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98099>
2015-06-02 17:17:17 +02:00
Nicolas Goaziou 0f93638ce1 org-colview: Handle user-defined inheritance
* lisp/org-colview.el (org-columns): Rely on `org-entry-get' instead
  of `org-entry-properties' in order to handle inheritance properly.
  Also limit search to properties actually used as columns instead of
  all properties.

Reported-by: Nik Clayton <nik@ngo.org.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/98091>
2015-06-02 17:04:40 +02:00
Nicolas Goaziou b42642f244 Ensure special properties ignore inheritance
* lisp/org.el (org-entry-get): Ensure special properties ignore user's
  inheritance rules.
2015-06-02 16:34:33 +02:00
Nicolas Goaziou 7b333c7249 Fix typo
* lisp/org.el (org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Fix typo.

Reported-by: Michael Strey <mstrey@strey.biz>
<http://permalink.gmane.org/gmane.emacs.orgmode/98094>
2015-06-02 15:39:50 +02:00
Nicolas Goaziou 1a73641770 Fix `org-olpath-completing-read'
* lisp/org.el (org-olpath-completing-read): Feed
  `org-icompleting-read' with COLLECTION argument too.
2015-06-01 18:20:46 +02:00
Nicolas Goaziou 458bde5243 Revert "Silence byte-compiler"
This reverts commit 722b5e724e.
2015-06-01 09:32:32 +02:00
Nicolas Goaziou 722b5e724e Silence byte-compiler
* lisp/org.el (format-spec): Silence byte-compiler when using "make
  single".
2015-06-01 09:24:42 +02:00
Nicolas Goaziou 31f8911495 Tiny fix
* lisp/org.el (org-create-formula-image): Atoms shouldn't be quoted
  when used as `case' keys.
2015-06-01 09:21:47 +02:00
Nicolas Goaziou 9e1591cbd0 Fix storing link in edit buffer
* lisp/org.el (org-store-link): When creating a link from an edit
  buffer, re-use label on current line, if any.  Give up if call is
  non-interactive, as it would otherwise ask for user's input.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97902>
2015-05-31 01:54:49 +02:00
Bjarte Johansen f6c75f2e41 Org Babel now supports sed scripts
* doc/org.texi: Signal new babel language.

* lisp/ob-sed.el:
* testing/examples/ob-sed-test.org:
* testing/lisp/test-ob-sed.el: New files.
2015-05-30 14:59:01 +02:00
Nicolas Goaziou a0c1e490b3 Silence byte-compiler
* lisp/org-footnote.el:
* lisp/org-list.el:
* lisp/org-macro.el:
* lisp/org-src.el:
* lisp/org.el: Silence byte-compiler.
2015-05-30 14:28:35 +02:00
Nicolas Goaziou 5e63d35ace ox-texinfo: Change output for links to targets with no description
* lisp/ox-texinfo.el (org-texinfo-link): Change output for links to
  targets with no description.

See <http://permalink.gmane.org/gmane.emacs.orgmode/98007>.
2015-05-30 13:52:26 +02:00
Nicolas Goaziou 82b4b8a98c ox-texinfo: Refer to "Top" instead of "top"
* lisp/ox-texinfo.el (org-texinfo-link): Refer to "Top" instead of
  "top".
2015-05-30 12:29:50 +02:00
Nicolas Goaziou 0194425d52 ox-texinfo: Fix link to headlines
* lisp/ox-texinfo.el (org-texinfo-link): Reverse behaviour whether
  headline is numbered or not.
2015-05-30 12:20:10 +02:00
Nicolas Goaziou d00dcd09ca org: Fix typo
* lisp/org.el (org-not-done-heading-regexp): Fix a typo and make
  variable buffer-local, as expected.

Reported-by: Alexander Borkowski <alex-b@opus-b.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97996>
2015-05-30 00:06:54 +02:00
Rasmus 4b2536d750 org.el: Add documentation for grffile
* org.el (org-latex-default-packages-alist): Add documentation for
  grffile.
2015-05-29 12:43:52 +02:00
Rasmus 56c5382684 org.el: Add grffile to default latex packages
* org.el (org-latex-default-packages-alist): Add grffile for files
  with spaces and periods.

Reported-by: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97846>
2015-05-29 11:54:46 +02:00
Nicolas Goaziou bb15b3937b ox-texinfo: Fix generated label
* lisp/ox-texinfo.el (org-texinfo-src-block):
(org-texinfo-table): Use `org-export-get-reference' to build internal
labels.
2015-05-29 11:43:28 +02:00
Nicolas Goaziou 1bd26e2d81 ox-texinfo: Put Texinfo output into `compilation-mode'
* lisp/ox-texinfo.el (org-texinfo-compile): Put Texinfo output into
  `compilation-mode'.

Suggested-by: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97961>
2015-05-29 11:31:01 +02:00
Nicolas Goaziou 0ed99a4c8c ox-texinfo: Fix labelled images without caption
* lisp/ox-texinfo.el (org-texinfo--inline-image): Add an @anchor for
  labelled images without a caption.

Reported-by: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97961>
2015-05-29 11:27:10 +02:00
Nicolas Goaziou a33acf6191 org-src: Fix indentation rampage when editing src blocks
* lisp/org-src.el (org-edit-src-code): Do not add indentation at every
  edit when `org-src-preserve-indentation' is non-nil.

Function taking care of indentation cannot check
`org-src--preserve-indentation' since the variable is buffer-local and
indentation happens in a temporary buffer.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97927>
2015-05-29 09:55:56 +02:00
Nicolas Goaziou 317886f53d ob-latex: Define LaTeX-specific headers
* lisp/ob-latex.el (org-babel-header-args:latex): New variable.

Reported-by: Andreas Leha <andreas.leha@med.uni-goettingen.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97905>
2015-05-27 12:23:59 +02:00
Bjarte Johansen 041ca4b6f4 ob-core: Do not return results on writing to file
* ob-core (org-babel-result-cond): Add "file" as a param that returns
  a scalar result.

When writing the result to file we do not need to first convert the
data to a table since it is just converted back when
org-babel-execute-src-block serializes the result to file.
2015-05-26 23:54:53 +02:00
Nicolas Goaziou 3062753e16 org-src: Change ambiguous variable name
* lisp/org-src.el (org-src--preserve-indentation): New variable.
(org-src--contents-for-write-back):
(org-src--edit-element):
(org-edit-src-code): Use new change.

Before this change `org-src-preserve-indentation' was both a defcustom
and an internal local variable.  Both uses are now separated.
2015-05-26 21:47:05 +02:00
Nicolas Goaziou e8ab947544 ob-lilypond: Fix a few variables
* lisp/ob-lilypond.el (org-babel-lilypond-ly-command):
(org-babel-lilypond-pdf-command):
(org-babel-lilypond-midi-command): Turn into a defvar.  Improve
docstring.
(org-babel-lilypond-gen-png):
(org-babel-lilypond-gen-svg):
(org-babel-lilypond-gen-html):
(org-babel-lilypond-gen-pdf):
(org-babel-lilypond-use-eps):
(org-babel-lilypond-arrange-mode): Improve docstring.
2015-05-26 21:37:04 +02:00
Nicolas Goaziou 59da320b30 org-src: Fix auto-save feature
* lisp/org-src.el (org-src-mode): Do not stop auto save feature when
  current buffer is no longer an edit buffer.

Reported-by: Andreas Leha <andreas.leha@med.uni-goettingen.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97892>
2015-05-26 17:06:53 +02:00
Nicolas Goaziou a714c3a118 Fix visibility with `org-cycle-separator-lines' at -1
* lisp/org.el (org-cycle-show-empty-lines): Fix visibility cycling
  with `org-cycle-separator-lines' set to -1.

Reported-by: Michael Crouch <creidieki@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97879>
2015-05-26 16:29:08 +02:00
Bjarte Johansen b6934e3471 ob-core: Fix indented cached result returning nil
Fix a problem where a source block would return nil oif the result was
cached and it was indented.

* lisp/ob-core.el (org-babel-execute-src-block): Move point to the the
 first character of the result instead of the beginning of the line.

* testing/lisp/test-ob.el
 (test-org-babel/indented-cached-org-bracket-link): Added test to
 to see if the indented cached result returns what it should return.
2015-05-26 10:19:42 +02:00
Nicolas Goaziou 4049c680fb ox-texinfo: Handle listings with captions and list of listings
* lisp/ox-texinfo.el (org-texinfo-keyword): Handle "#+TOC: listings".
(org-texinfo-src-block): Wrap listings with captions within @float.
2015-05-26 10:03:59 +02:00
Nicolas Goaziou e36139ea02 ox-texinfo: Handle tables with captions and list of tables
* lisp/ox-texinfo.el (org-texinfo-table): Wrap captionned tables
  within a @float command.
(org-texinfo-keyword): Handle "#+TOC: tables".
2015-05-26 10:03:53 +02:00
Nicolas Goaziou deb4fe7838 ox-texinfo.el: Refactor caption code
* lisp/ox-texinfo.el (org-texinfo--wrap-float): New function.
(org-texinfo--inline-image): Use new function.
2015-05-26 09:41:02 +02:00
Nicolas Goaziou 20a3b61865 ox-texinfo: Rename an internal function
* lisp/ox-texinfo.el (org-texinfo--filter-section-blank-lines):
  Renamed from `org-texinfo-filter-section-blank-lines'.
(texinfo): Apply renaming.
2015-05-26 09:22:53 +02:00
Nicolas Goaziou 6ba3e60a68 ox-texinfo: Improve caption handling
* lisp/ox-texinfo.el (org-texinfo--inline-image): Apply appropriate
  restrictions if caption is meant to be also used in list of floats.
2015-05-26 09:18:00 +02:00
Nicolas Goaziou 5b3d47cf56 org-src: Fix error when editing footnote references
* lisp/org-src.el (org-src--contents-area): Define BEG and END.
2015-05-26 01:17:34 +02:00