Commit Graph

12888 Commits

Author SHA1 Message Date
Nicolas Goaziou c07175bfaa Remove reference to removed function in menu
* lisp/org.el (org-org-menu): Remove reference to
  `org-beamer-insert-options-template'.

Reported-by: Giacomo M <jackjackk@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107658>
2016-06-10 18:22:16 +02:00
Rasmus af463605f1 Document org-block face changes
* doc/org.texi (Editing source code): Document org-block and
  org-block-LANG faces.
* lisp/org-faces.el (org-block): Mention org-block-LANG faces.
* lisp/org.el (org-src-fontify-natively): Add reference to org-block.
* etc/ORG-NEWS: Update entry.
2016-06-10 10:11:03 +02:00
Rasmus b0def38b4b org-src: Allow per language block face
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Allow per-block
  face.

Suggested-by: Karl Voit <devnull <at> Karl-Voit.at>
<http://thread.gmane.org/gmane.emacs.orgmode/103833/focus=107645
2016-06-10 09:20:30 +02:00
Rasmus 81af689d0f org-src: Src-blocks also inherit org-block face
* lisp/org-src.el (org-src-font-lock-fontify-block): Inherit org-block
  face in addition to language specific faces.
* etc/ORG-NEWS: Add entry.
2016-06-09 16:18:17 +02:00
Marco Wahl 7e57cf5d40 org: Fix tags extraction
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to
  match all tags (and not just the last.)
* testing/lisp/test-org.el (test-org/tags-at): One test to cover the
  issue.
2016-06-09 10:06:14 +02:00
Nicolas Goaziou f94df5456f ox-texinfo: Add support for strike-through and underline markup
* lisp/ox-texinfo.el (texinfo): Add transcoders.
(org-texinfo-text-markup-alist): Allow `strike-though' and `underline'
as keys.  Remove unused `comment'.
(org-texinfo-strike-through):
(org-texinfo-underline): New functions.

By default, new markup produce no Texinfo code, but can be customized by
users for specific uses.
2016-06-04 22:40:21 +02:00
Nicolas Goaziou 6daad64277 org-compat: Silence byte-compiler 2016-06-04 22:09:15 +02:00
Nicolas Goaziou 2c70283641 org-colview: Fix docstrings
* lisp/org-colview.el (org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix argument name in docstrings.
2016-06-04 21:29:27 +02:00
Don March bd49486db9 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:45:41 +02:00
Don March 42620c1efa Rename org-deadline-is-close to have -p suffix
* lisp/org-agenda.el
  (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
* lisp/org.el (org-deadline-close): Rename to...
  (org-deadline-close-p): ...this.

* testing/lisp/test-org.el (test-org/deadline-close): Rename to...
  (test-org/deadline-close-p): ...this.
2016-06-04 20:39:15 +02:00
Don March 43b5ca1626 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:39:15 +02:00
Nicolas Goaziou 3fd361eb77 Merge branch 'maint' 2016-06-02 13:33:34 +02:00
Yasushi SHOJI 361fa80eba Fix tag width calculation for multi-column chars
* lisp/org.el (org-align-tags-here): Fix tag width calculation for
  multi-column chars.

Some characters have multiple column width.  Calculating string width
with points gives a wrong value than actual display width.  Use
`string-width' instead.

Here is an ECM for this problem.  `M-x org-update-statistics-cookies` or
`C-c #` on bar moves the tag on the headline.

* foo [0/0]								🔤
** child
* bar [0/0]							     :日本語:
** child
12345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8
2016-06-02 13:31:09 +02:00
Nicolas Goaziou ecf20715e2 Merge branch 'maint' 2016-06-01 14:54:20 +02:00
Nicolas Goaziou 1f3d72e8b4 Fix TODO case-sensitivity in `org-get-heading'
* lisp/org.el (org-get-heading): Prevent removing false-positive TODO
  keywords due to case-insensitivity.
* testing/lisp/test-org.el (test-org/get-heading): New test.
2016-06-01 14:49:59 +02:00
Nicolas Goaziou 319c05f1dc Merge branch 'maint' 2016-06-01 00:44:55 +02:00
Nicolas Goaziou a1df8cfe71 Fix case-sensitivity of TODO keywords in imenu
* lisp/org.el (org-imenu-get-tree): Todo keywords are case-sensitive.

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107500>
2016-06-01 00:43:28 +02:00
Nicolas Goaziou 11d6ebc60f Fix `org-in-regexp'
* lisp/org.el (org-in-regexp): Fix VISUALLY optional argument.  Also
  prevent useless searches past the point.  Improve docstring.

* testing/lisp/test-org.el (test-org/in-regexp): New test.
2016-05-31 23:34:14 +02:00
Nicolas Goaziou 21ba5f510e Refuse to follow link right after the link
* lisp/org.el (org-open-at-point):
(org-return): Refuse to follow link right after the link.

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

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102054>
2016-05-31 23:34:00 +02:00
Nicolas Goaziou 3d0ade9571 By default, use relative name for compilation
* lisp/org.el (org-compile-file): %f meant relative name of compiled
  file.  %F is its full name.  Also always set `default-directory' to
  the directory of the source.

Reported-by: Stig Brautaset <stig@brautaset.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/107348>
2016-05-30 00:13:22 +02:00
Nicolas Goaziou cf77060d18 Fix last commit
* lisp/org.el (org-edit-headline): Fix `save-match-data' scope.

`org-trim' modifies match data. `read-string' doesn't.
2016-05-30 00:02:27 +02:00
Marco Wahl 127f86bdc5 org: Fix interactive headline edit
* lisp/org.el (org-edit-headline): Save match-data before calling
  read-string.
2016-05-28 12:01:14 +02:00
Nicolas Goaziou f2c421d3c0 org-compat: Fix last commit
* lisp/org-compat.el (org-with-silent-modifications): Remove spurious
  definition introduced in last commit.
2016-05-26 16:41:17 +02:00
Nicolas Goaziou 0dfb046983 org-compat: Silence byte-compiler 2016-05-26 16:29:40 +02:00
Nicolas Goaziou bf5ebe1fdd Silence byte-compiler in Emacs 25.1
* lisp/org-compat.el (org-get-x-clipboard): Use `gui-get-selection',
  which obsoletes `x-get-selection'.  Define the former as an alias for
  the latter for backward compatibility.
2016-05-26 16:22:20 +02:00
Nicolas Goaziou 770711153d org-macro: Use cl-lib 2016-05-26 16:16:31 +02:00
Nicolas Goaziou 6176357b47 org-table: Add missing "cl-" prefixes
* lisp/org-table.el (org-table--descriptor-line):
(org-table--row-type): Add "cl-" prefixes.
2016-05-26 16:12:42 +02:00
Nicolas Goaziou f9ad16b22a ob-core: Do not require `cl' since `cl-lib' is used
* lisp/ob-core.el (org-babel-merge-params):
(org-babel-noweb-p):
(org-babel--script-escape-inner): Use "cl-" prefix.
2016-05-26 16:11:06 +02:00
Nicolas Goaziou 82f834ea90 ox-icalendar: Do not require `cl' since `cl-lib' is used
* lisp/ox-icalendar.el (org-icalendar-get-categories):
(org-icalendar-entry):
(org-icalendar--vevent): Use "cl-" prefix.
2016-05-26 16:08:15 +02:00
Nicolas Goaziou a169e43a77 org-table: Do not require `cl' since `cl-lib' is used
* lisp/org-table.el (org-table-align):
(org-table-current-column):
(org-table-current-dline):
(org-table-sort-lines):
(org-table-paste-rectangle):
(org-table-analyze):
(org-table-get-range):
(org-table--row-type):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-formula-handle-first/last-rc):
(org-table-formula-substitute-names):
(orgtbl-send-table):
(orgtbl-to-generic): Use "cl-" prefix.
2016-05-26 16:06:09 +02:00
Nicolas Goaziou e8120fbd55 ox-beamer: Do not require `cl' since `cl-lib' is used
* lisp/ox-beamer.el (org-beamer--normalize-argument):
(org-beamer-link): Use "cl" prefix.
2016-05-26 15:57:11 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Nicolas Goaziou 4129ae6737 Remove some XEmacs compatibility layer
* lisp/ob-calc.el (calc-trail):
* lisp/ob-python.el (org-babel-python-mode):
* lisp/org-agenda.el (org-agenda-tags-column):
(org-agenda-show-new-time):
* lisp/org-clock.el (org-clock-update-mode-line):
(org-clock-put-overlay):
(org-clock-resolve):
* lisp/org-faces.el (org-faces):
* lisp/org-indent.el (org-indent-mode):
* lisp/org-macs.el (org-load-noerror-mustsuffix):
* lisp/org-table.el (orgtbl-setup):
* lisp/org.el (org-key):
(org-self-insert-cluster-for-undo):
(org-tags-column):
(org-emphasis-alist):
(org-mode):
(org-set-font-lock-defaults):
(org-cycle-internal-local):
(org-tree-to-indirect-buffer):
(org-set-frame-title):
(org-priority):
(org-set-tags):
(org-set-current-tags-overlay):
(org-toggle-time-stamp-overlays):
(org-display-custom-time):
(org-diary-to-ical-string):
(org--format-latex-make-overlay):
(org-dvipng-color):
(org-latex-color):
(org-mode-map):
(org-speed-commands-default):
(org-reload):
(org-display-warning):
(org-end-of-line):
* lisp/ox-man.el (org-man-inline-src-block):
* contrib/lisp/org-vm.el (org-vm-follow-link):
* contrib/lisp/ox-groff.el (org-groff-inline-src-block):
(org-groff-src-block): Remove some XEmacs compatibility layer.
2016-05-26 11:30:11 +02:00
Nicolas Goaziou 84f8c9a226 ox-latex: Use "cl-lib"
* lisp/ox-latex.el (org-latex--label):
(org-latex--caption/label-string):
(org-latex--find-verb-separator):
(org-latex--text-markup):
(org-latex-inline-src-block):
(org-latex-item):
(org-latex-keyword):
(org-latex--inline-image):
(org-latex-link):
(org-latex-plain-text):
(org-latex-matrices):
(org-latex--script-size):
(org-latex--align-string):
(org-latex--table.el-table):
(org-latex-timestamp): Use "cl-" prefix.
2016-05-26 11:03:11 +02:00
Nicolas Goaziou 5ac93681b2 Merge branch 'maint' 2016-05-26 10:55:00 +02:00
Nicolas Goaziou 655fb33967 org-agenda: Effectively preserve persistent bulk marks
* lisp/org-agenda.el (org-agenda-change-all-lines): Preserve bulk mark
  overlay when replacing an entry.

Reported-by: Jesse Johnson <holocronweaver@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107299>
2016-05-26 10:51:58 +02:00
Nicolas Goaziou 4c58ee0a4b org-agenda: Add missing docstring
* lisp/org-agenda.el (org-agenda-bulk-marked-p): Add missing docstring.
2016-05-26 10:51:27 +02:00
Rasmus 9dbeaa278d ox-latex: Fix bug introduced in 888ebfdeaf
* lisp/ox-latex.el (org-latex-footnote-reference): Handle anonymous
  footnotes.

Reported-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/107381>
2016-05-25 19:48:51 +02:00
Rasmus 888ebfdeaf ox-latex: More robust repeated footnote references
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions): Fix typo
  in docstring.
(org-latex-footnote-defined-format): New defcustom.
(org-latex-footnote-reference): Refer to repeated footnotes using
labels.  Format using new defcustom.
* etc/ORG-NEWS: Mention change.
* doc/org.texi (Publishing options): Add new defcustom.
2016-05-25 09:14:52 +02:00
Rasmus 21fa7efa99 ox-org: Add footnote prefix
* lisp/ox-org.el (org-org-section): Add mandatory "fn" prefix to
  footnotes.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107366>
2016-05-25 08:51:13 +02:00
Feng Shu 2a8a8b3109 Fix typo
* org.el (org-preview-latex-process-alist): Fix typo in docstring.
2016-05-24 22:23:23 +02:00
Nicolas Goaziou 96cfef229d ox: Small refactoring
* lisp/ox.el (org-export-get-loc): Refactor code.  Speed-up processing
  when the element doesn't require line numbering.
* testing/lisp/test-ox.el (test-org-gen-loc-list): Reformat code.
2016-05-24 21:40:43 +02:00
Brian Carlson af8e3d84ee ox: Provide offset to [+-]n in SRC/EXAMPLE export
* lisp/org-element.el (org-element-example-block-parser): Use cons cell
  for :number-lines specifying offset in addition to type (new/continue).
  ('continue . offset) for :number-lines will add this offset count to
  the last line number. ('new . offset) for :number-lines will reset the
  line number counting starting at offset
(org-element-src-block-parser): same for SRC block as EXAMPLE block

* lisp/ox-html.el (org-html-format-code):
* lisp/ox-latex.el (org-latex-src-block):
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-resolve-coderef):
(org-export-get-loc):
(org-export-format-code-default):
* contrib/lisp/ox-groff.el (org-groff-src-block): Use new cons cell
  for :number-lines.

* testing/lisp/test-ox.el  (ert-deftest test-org-export/get-loc): Tests for
changes
(test-org-gen-loc-list): Helper function for `test-org-export/get-loc'.
2016-05-24 21:40:35 +02:00
Feng Shu 6826ccdebc Latex previewing: imagemagick use pdflatex by default
* org.el (org-preview-latex-process-alist): Use "pdflatex" instead of
  "latex".
2016-05-24 19:27:29 +02:00
Trevor Murphy c20f51ccc0 Place `org-clock-heading' outside clock time
* org-clock.el (org-clock-get-clock-string): When `org-clock-effort'
  is nil, arrange the format string components separately, similar to
  how they are arranged when o-c-e is not-nil.
2016-05-23 22:46:54 +02:00
Rasmus 9488d13094 Merge branch 'maint' of orgmode.org:org-mode into maint 2016-05-23 09:06:56 +02:00
Rasmus 58f5def625 ox-latex.el: Format-spec checks Polyglossia
* ox-latex.el (org-latex--format-spec): Also check Polyglossia language.
2016-05-23 09:00:54 +02:00
Rasmus 42bc27b473 Merge branch 'maint' 2016-05-23 08:59:29 +02:00
Rasmus 8c968a9697 ox-latex: Detect languages irrespective of case
* ox-latex.el (org-latex-guess-babel-language):
* ox-latex.el (org-latex--format-spec): Detect languages correctly
  irrespective of case.
2016-05-23 08:45:54 +02:00
Nicolas Goaziou 3c729c7c0b Merge branch 'maint' 2016-05-23 01:20:17 +02:00
Nicolas Goaziou 6105643903 org-table: Fix 4914f89
* lisp/org-table.el (orgtbl-setup): Fix improper key binding
  specification.

Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107287>
2016-05-23 01:19:29 +02:00
Nicolas Goaziou dba7652445 Merge branch 'maint' 2016-05-23 01:17:23 +02:00
Nicolas Goaziou f311921ad3 org-list: Fix `org-list-send-list' in LaTeX buffers
* lisp/org-list.el (org-list-send-list): Find correct translator.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107290>
2016-05-23 01:12:51 +02:00
Rasmus 9a7bf6d649 Merge branch 'maint' 2016-05-22 15:31:27 +02:00
Rasmus d07fafed4a ox-html: Find preamble-spec case-insensitively
* ox-html.el (org-html--build-pre/postamble): Find the spec based on the
  language case-insensitively.

Note that the default org-html-preamble-format and
org-export-default-language are incompatible.
2016-05-22 15:30:11 +02:00
Nicolas Goaziou 2ed5e64a74 Merge branch 'maint' 2016-05-21 14:41:38 +02:00
Nicolas Goaziou 4914f89644 org-table: Fix DEL using orgtbl minor mode in prog derived mode
* lisp/org-table.el (orgtbl-setup): Hijack DEL key.  We also hijack
  `delete-backward-char' but major modes derived from `prog-mode'
  usually bypass it.

Reported-by: Alex G <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107232>
2016-05-21 14:39:26 +02:00
Feng Shu bf93e166be Use dvisvgm to preview latex formulas
* ox-html.el (org-html-with-latex): Add dvisvgm support.
(org-html-with-latex): Add dvisvgm support.
(org-html-format-latex): "ltxpng" -> "ltximg".
(org-html-latex-environment): Add dvisvgm support.
(org-html-latex-fragment): Add dvisvgm support.

* org.el (org-preview-latex-default-process): New variable.
(org-latex-create-formula-image-program): Rename it to `org-preview-latex-default-process'.
(org-latex-preview-ltximg-directory): Rename it to `org-preview-latex-image-directory'.
(org-preview-latex-image-directory): New variable.
(org--format-latex-make-overlay): Add optional image-type, which used to deal with svg.
(org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
(org-format-latex): Add dvisvgm support.
(org-create-formula-image): Big refactor, merge dvipng and imagemagick
backend's feature.  Add dvisvgm feature.
(org-preview-latex-process-alist): Add new variable, which used to set
latex preview processes.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Useless, removed.

* org.texi (@LaTeX{} fragments):
(Previewing @LaTeX{} fragments):
(Math formatting in HTML export):
(Working with @LaTeX{} math snippets): Add dvisvgm information.
2016-05-21 10:50:38 +02:00
Nicolas Goaziou a5f83857c1 Merge branch 'maint' 2016-05-20 23:05:59 +02:00
Nicolas Goaziou 1d2f52f487 org-table: Fix orgtbl-self-insert-command on white spaces
* lisp/org-table.el (orgtbl-self-insert-command): Properly overwrite
  white spaces when there is room for it.  This is on par with what
  `org-self-insert-command' does in Org tables.

Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107112>
2016-05-20 23:03:18 +02:00
Nicolas Goaziou e234643d92 Fix `org-open-at-point-global'
* lisp/org.el (org-open-at-point-global): Handle any external link
  looking like an Org link or time-stamp.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/107220>
2016-05-20 22:04:11 +02:00
Nicolas Goaziou 2d846210eb Implement conditional case-fold search in org-occur
* lisp/org.el (org-occur-case-fold-search): New variable.
(org-occur): Use new variable.

* testing/lisp/test-org.el (test-org/occur): Add tests.
2016-05-20 14:04:04 +02:00
Nicolas Goaziou 11e2df8091 ob-exp: Small speed-up
* lisp/ob-exp.el (org-babel-exp-src-block): Refer to block position
  instead of line.

`org-current-line' is costly in large buffers.
2016-05-20 13:41:16 +02:00
Nicolas Goaziou 8eb582b951 ox-texinfo: Allow :options attribute on special blocks
* lisp/ox-texinfo.el (org-texinfo-special-block): Handle :options
  attribute.
* doc/org.texi (Texinfo specific attributes): Add special block section.
2016-05-19 19:15:55 +02:00
Nicolas Goaziou 920cfbd921 org-agenda: Fix agenda filter by empty tag string
* lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): Handle
  empty tag strings.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107121>
2016-05-19 10:31:27 +02:00
Nicolas Goaziou ea1147a479 Add `org-compile-file' and `org-file-newer-than-p'
* lisp/org.el (org-compile-file):
(org-file-newer-than-p): New functions.

* lisp/ox-latex.el (org-latex-compile): Use new functions.

* lisp/ox-man.el (org-man-compile): Use new functions.
(org-man-collect-errors): Remove it.

* lisp/ox-texinfo.el (org-texinfo-compile): Use new functions.
(org-texinfo-collect-errors): Remove function as it is not accurate
enough (e.g., it doesn't handle internationalization).
2016-05-19 09:44:05 +02:00
Kyle Meyer 14f853dceb ox-publish: Correct docstring typo
* lisp/ox-publish.el (org-publish-project-alist): Correct typo in
  docstring.
2016-05-18 22:05:41 -04:00
Kyle Meyer 4efae4f1ff Adjust function declaration changes from 291938d
* lisp/org-macro.el (org-with-wide-buffer): Remove unnecessary
declaration.
(vc-call): Signal that FN is not a defun.  Match arguments.
2016-05-18 22:05:36 -04:00
Rasmus 291938d0b0 org-macro.el: Allow modification-time from vc.el
* org-macro.el (org-macro--vc-modified-time): New function.
* org-macro.el (org-macro-initialize-templates): Add support for new
  function.
* doc/org.texi (Macro replacement): Document new behavior.
* etc/ORG-NEWS: Mention new behavior.
2016-05-18 21:39:37 +02:00
Rasmus 44ad9ff3e4 ox-publish.el: Document `:recursive'
* ox-publish.el (org-publish-project-alist): Document `:recursive'.
2016-05-18 12:00:17 +02:00
Nicolas Goaziou ad766435dc Merge branch 'maint' 2016-05-16 11:21:05 +02:00
Phil Hudson 5fc351ab78 org-capture: Support all capture template target-file variants in Customize
* lisp/org-capture.el (`org-capture-templates'): Adjust the
  `org-capture-templates' defcustom template to support specifying the capture
  target file using either a literal pathname, a function, a variable or a
  form, as documented.  Previously the Customize UI supported specifying only a
  literal pathname.
  (org-capture-templates): Clarify the documentation for the `function' method
  for setting up the capture target.

* doc/org.texi (Template elements): Clarify the `function' method for setting up
  the capture target.
2016-05-16 11:17:26 +02:00
Kyle Meyer d1fb75bc17 ob-comint: Remove unnecessary function declarations
These aren't needed because tramp is explicitly loaded.
2016-05-15 19:57:17 -04:00
Kyle Meyer d38e91867c Fix remaining declare-function issues on master
* lisp/org-list.el (org-export-create-backend):
Indicate that FN is not a defun.
* lisp/org-list.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-get-backend):
(org-export-get-environment):
(org-export-get-next-element):
(org-export-with-backend):
Correct source file name.
* lisp/org.el (calendar-check-holidays):
(org-agenda-format-item):
Correct argument list.
2016-05-15 19:16:30 -04:00
Kyle Meyer 4925d5be7b Merge branch 'maint' 2016-05-15 19:00:30 -04:00
Kyle Meyer 19cf68da90 Fix remaining declare-function issues
* lisp/ob-shell.el (org-babel-comint-in-buffer):
(org-babel-comint-with-output):
* lisp/org-table.el (org-export-create-backend):
* lisp/org.el (org-babel-do-in-edit-buffer): Indicate that FN is not a
defun.
* lisp/ob-tangle.el (org-string-nw-p):
* lisp/org-table.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-filter-apply-functions):
(org-export-first-sibling-p):
(org-export-get-backend):
(org-export-get-environment):
(org-export-install-filters):
(org-export-table-has-special-column-p):
(org-export-table-row-is-special-p): Correct source file name.
* lisp/ob-R.el (ess-wait-for-process):
* lisp/org-clock.el (calendar-iso-to-absolute):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-pcomplete.el (org-entry-properties):
* lisp/org-table.el (org-export-data-with-backend):
(org-export-get-environment):
* lisp/org.el (org-element-interpret-data): Correct argument list.
2016-05-15 18:59:20 -04:00
Kyle Meyer e712f17822 org-compat: Quiet font-lock-fontify-buffer warning
* lisp/org-compat.el (org-font-lock-ensure): Quiet byte compiler warning
  about font-lock-fontify-buffer.
2016-05-15 18:59:19 -04:00
Kyle Meyer 3b8fc502b9 org-compat: Check for w32-focus-frame
* lisp/org-compat.el (org-select-frame-set-input-focus): Check for
  w32-focus-frame to quiet byte compiler.

Don't use declare-function because this function was marked obsolete in
Emacs 23.1 (44fe0f6).
2016-05-15 18:59:19 -04:00
Kyle Meyer 0e0963acbf org-gnus: Check nnimap-group-overview-filename
* lisp/org-gnus.el (org-gnus-nnimap-cached-article-number): Check that
  nnimap-group-overview-filename, which was removed from Emacs in 2010,
  is defined before calling.
2016-05-15 18:59:19 -04:00
Kyle Meyer 1c9bb0dba8 Fix up last backport
* lisp/org.el (org-export-backend-options): Add back removed
declare-function call.
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-gnuplot.el (orgtbl-to-generic): Remove BACKEND argument from
declare-function calls.

The last backport added this argument to match orgtbl-to-generic's
signature in Emacs's version of Org, but the BACKEND argument to
orgtbl-to-generic was later removed in 9209aa3 (org-table: Use "ox.el"
internally for radio tables, 2014-08-24).
2016-05-15 18:59:19 -04:00
Paul Eggert 1f046ea4b1 Backport commit 65c8c7c from Emacs
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-exp.el (org-element-context):
* lisp/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/ob-haskell.el (org-export-to-file):
* lisp/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/ob-python.el (run-python):
* lisp/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org-colview.el (org-agenda-redo):
* lisp/org-feed.el (url-retrieve-synchronously):
* lisp/org-info.el (Info-find-node):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-macs.el (org-string-match-p):
* lisp/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/ob-comint.el (tramp-flush-directory-property):
* lisp/ob-tangle.el (org-babel-update-block-body):
* lisp/org-bibtex.el (org-babel-trim):
* lisp/org-pcomplete.el (org-export-backend-options):
* lisp/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/ob-comint.el (with-parsed-tramp-file-name)
* lisp/ob-core.el (with-parsed-tramp-file-name):
* lisp/org.el (org-beamer-mode):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/ob-core.el (org-save-outline-visibility):
Remove; not needed.
* lisp/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.

Pacify ‘make check-declare’
65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Paul Eggert
Sat May 14 19:57:44 2016 -0700
2016-05-15 18:59:16 -04:00
Nicolas Goaziou e4eebe97ec ox-org: Handle export blocks
* lisp/ox-org.el (org-org-export-block): New function.
2016-05-13 17:57:11 +02:00
Nicolas Goaziou a540e894b6 org-element: Properly unescape data in export blocks
* lisp/org-element.el (org-element-export-block-parser): Remove commas
  in export blocks.
* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
  Add test.
2016-05-13 17:55:30 +02:00
Nicolas Goaziou 1c923b9ae7 org-src: Allow writing remote edit buffers to file
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Do not treat
  each save as meant to save source buffer.

Reported-by: David Dynerman <david@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/106998>
2016-05-11 23:18:38 +02:00
Nicolas Goaziou 702bab9ee2 Merge branch 'maint' 2016-05-11 22:50:38 +02:00
Nicolas Goaziou 34dc298869 org-agenda: Fix `org-agenda-bulk-custom-functions' supported Customize type
* org-agenda.el (`org-agenda-bulk-custom-functions'): Change the defcustom
  template to recognize that the code expects this alist's elements to be
  two-element lists like (?a b), not conses like (?a . b).

The Customize UI previously incorrectly presented the latter.  When
saved, this led to the agenda bulk-commands menu correctly presenting
the accelerator key 'a' but then erroring when it tried to execute the
associated command 'b'.
2016-05-11 22:49:25 +02:00
Nicolas Goaziou b687cf37a5 Merge branch 'maint' 2016-05-11 18:46:28 +02:00
Nicolas Goaziou ee5d40b001 org-clock: Fix `org-clock-drawer-name'
* lisp/org-clock.el (org-clock-drawer-name): When
  `org-clock-into-drawer' is a number and `org-log-into-drawer' is t,
  default to "LOGBOOK".

* testing/lisp/test-org-clock.el (test-org-clock/into-drawer):
(test-org-clock/drawer-name): New tests.
2016-05-11 18:44:02 +02:00
Charles Berry 779222eba5 ob-comint.el: Require `tramp' and declare tramp functions
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  The tramp macro `with-parsed-tramp-file-name' invokes a bunch of
  tramp functions.  These are now declared and tramp is explicitly
  required.
2016-05-10 18:22:03 -07:00
Nicolas Goaziou 9210300260 Merge branch 'maint' 2016-05-10 23:08:34 +02:00
Nicolas Goaziou d1786a0908 org-clock: Fix generated drawer when `org-clock-into-drawer' is numerical
* lisp/org-clock.el (org-clock-find-position): Create a default
  "LOGBOOK" drawer when `org-clock-into-drawer' is a numeric value.

Reported-by: Carlos Noguera <carlos.francisco.noguera@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106886>
2016-05-10 22:42:38 +02:00
Robert Klein 59237bc028 ox-html: Support more programming languages in CSS
* lisp/ox-html.el (org-html-style-default): Add languages.

The standard CSS for HTML export only supported a couple of
programming languages to have a language name "hover" on src
blocks.  This patch adds all languages supported per Org
manual, those from org.el's org-babel-load-languages-alist,
additional language identifiers in ob-*.el and languages
which have a) an emacs mode and b) are supported by the LaTeX
listings package.  Additional a language "conf" is supported
for generic configuraiton files; an emacs mode exists for
this, but for LaTeX listings a language " " has to be faked.
As this patch is for HTML, this is no impediment.

Thanks for reporting the missing support to Tianxian XIONG.
2016-05-10 22:21:21 +02:00
Nicolas Goaziou 8127b3c30d Merge branch 'maint' 2016-05-05 13:15:34 +02:00
Nicolas Goaziou 83e373f109 Fix `org-occur' when regexp matches a single char
* lisp/org.el (org-occur): Fix infloop when regexp matches a single
  char.  Improve docstring.

(org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Match correct object since point may be at the
beginning of the next one.

* testing/lisp/test-org.el (test-org/occur): New test.
2016-05-05 12:59:46 +02:00
Nicolas Goaziou 1ca1d52e92 Fix `org-occur' when called non-interactively
* lisp/org.el (org-first-headline-recenter): Check if current buffer is
  actually displayed in a window before trying to recenter view.
2016-05-05 11:55:00 +02:00
Nicolas Goaziou 3308a5ecfe Merge branch 'maint' 2016-05-04 14:23:57 +02:00
Nicolas Goaziou 8638c14fbd org-agenda: Fix error on empty headlines
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks): Handle empty headlines.
2016-05-04 14:20:09 +02:00
Chunyang Xu b46527a8ba org-capture: Adapt user-error for aborting by user
* lisp/org-capture.el (org-capture):
(org-mks): Replace `error' with `user-error'.

When `org-capture` is aborted by user with 'q' or 'C-g', `user-error' is
better than `error' when exiting.

TINYCHANGE
2016-05-03 19:17:34 +02:00
Rainer M. Krug d87bf07ea6 ob-plantuml: Add new output formats
* lisp/ob-paltuml (org-babel-execute:plantuml): add new output formats
  of plantuml:
  - pdf : this needs extra java mudules to run which are mentioned on the
    plantml website (http://fr.plantuml.com/pdf.html)
  - vdx
  - xmi
  - scxml
  - html
  - txt (ascii art)
  - utxt (ascii art using unicode)

  The output format is based on the extension of the output file.
2016-05-03 19:13:50 +02:00
Nicolas Goaziou 36dbdb9465 Fix keywords in defcustom
* lisp/org.el (org-show-context-detail): Fix keywords according to
  commit c112f40.
2016-05-01 01:32:16 +02:00
Nicolas Goaziou 590cb1227a Merge branch 'maint' 2016-05-01 01:30:57 +02:00
Nicolas Goaziou af853dd3aa Fix `org-flag-drawer' with optional argument
* lisp/org.el (org-flag-drawer): Do not require point to be at a drawer
  in order to call the function with an optional argument.

* testing/lisp/test-org.el (test-org/flag-drawer): Narrow test.
2016-05-01 01:27:30 +02:00
Nicolas Goaziou bb034dfe04 `org-show-context' always displays point
* lisp/org.el (org-show-set-visibility): Always show point, even when it
  is hidden in a block or a drawer.

* testing/lisp/test-org.el (test-org/show-set-visibility): Add tests.

Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106744>
2016-05-01 01:14:10 +02:00
Nicolas Goaziou c112f40d51 org-agenda: Remove unnecessary visibility modification
* lisp/org.el (org-show-context-detail): Change default visibility span
  for agenda context.

* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-todo):
(org-agenda-add-note):
(org-agenda-priority):
(org-agenda-set-tags):
(org-agenda-set-property):
(org-agenda-set-effort):
(org-agenda-toggle-archive-tag):
(org-agenda-clock-in): Special visibility is taken care of by
`org-show-context'.  Do not hard-code anything else.

* contrib/lisp/org-contacts.el (org-contacts-gnus-article-from-goto):
Special visibility is taken care of by `org-show-context'.  Do not
hard-code anything else.
2016-04-29 11:35:49 +02:00
Nicolas Goaziou 39cbbca8b6 ox-beamer: Fix "apply: Wrong number of arguments: max, 0"
* lisp/ox-beamer.el (org-beamer-select-environment): Use variable
  introduced in 4743d43.

Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
<http://permalink.gmane.org/gmane.emacs.orgmode/106705>
2016-04-28 23:29:17 +02:00
Nicolas Goaziou 3baf246f4f Handle correctly `shift-select-mode'
* lisp/org.el (org-beginning-of-line): Handle correctly `shift-select-mode'.

Reported-by: Mathieu Marques <mathieumarques78@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106783>
2016-04-28 23:28:15 +02:00
Nicolas Goaziou 6ed60a797a Merge branch 'maint' 2016-04-28 22:08:01 +02:00
Nicolas Goaziou c8c2d2b1f7 Fix multiple groups of mutually exclusive tags
* lisp/org.el (org-set-tags): Use a subtler mechansim to remove
  duplicate tags.  This fixes a bug introduced in 77b4fad.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106763>
2016-04-28 22:04:49 +02:00
Nicolas Goaziou ec615b192d Fix `org-export-babel-evaluate' handling
* lisp/ob-exp.el (org-babel-exp-process-buffer): Handle
  `org-export-babel-evaluate' handling.
(org-babel-exp-results): Ignore `org-export-babel-evaluate' since it is
handled as a higher level.

* lisp/ox.el (org-export-as): Allow to short-circuit babel evaluation if
  `org-export-babel-evaluate' is nil.

* testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): New test.

Reported-by: Nicolas Richard <nrichard@ulb.ac.be>
<http://permalink.gmane.org/gmane.emacs.orgmode/106767>
2016-04-28 17:29:14 +02:00
Nicolas Goaziou f227c2f1af Silence byte-compiler 2016-04-28 17:02:29 +02:00
Nicolas Goaziou 9508dc9af2 ox: Internal references are always 10 character long
* lisp/ox.el (org-export-format-reference): Internal references are
  always 10 character long.

This reduces further possible reference clashes with user-defined
labels.
2016-04-26 21:04:41 +02:00
Nicolas Goaziou 1daac70fc5 Merge branch 'maint' 2016-04-26 21:03:45 +02:00
Nicolas Goaziou e818699113 Fix storing links to headlines containing multiple links
* lisp/org.el (org-store-link): Fix storing links to headlines
  containing multiple links.

* testing/lisp/test-org.el (test-org/store-link): New test.

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106606>
2016-04-26 20:59:33 +02:00
Nicolas Goaziou 00a8275c62 Fix links to elements with a name
* lisp/org.el (org-store-link): Properly handle elements with a NAME
  keyword.
2016-04-26 18:58:01 +02:00
Nicolas Goaziou ce748a7ed5 Merge branch 'maint' 2016-04-26 18:47:43 +02:00
Nicolas Goaziou 91ea3920df ox-ascii: Fix spurious links
* lisp/ox-ascii.el (org-ascii--unique-links): Fix spurious links.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106667>
2016-04-26 18:46:34 +02:00
Charles Berry da4db33132 ob-comint.el: Revert yet another change
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Remove the `(ignore v)'.  This creates a byte-compiler warning for
  supposedly unused `v', but allows remote execution.
2016-04-23 17:03:26 -07:00
Charles Berry e1d6a43c8e ob-comint.el: Reinstate let-bound variable from last commit.
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Reinstate `let (v)' which `org-babel-evaluate-session' relies on.
2016-04-23 16:33:39 -07:00
Charles Berry e42454088f ob-comint.el: Fix bug and remove unused let binding
* ob-comint.el: (tramp-flush-directory-property declaration): The
  file is now "tramp-cache".

* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Remove unused let binding for `v' (which is let bound by
  `with-parsed-tramp-file-name').

Bug reported by Vikas Rawal
Subject: Using tramp to run R source code blocks on remote server
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/106557>
2016-04-23 16:07:46 -07:00
Kyle Meyer dfafc869a3 Merge branch 'maint' 2016-04-23 17:40:16 -04:00
Kyle Meyer ae73c75fa6 org-yank: Correct docstring
* lisp/org.el (org-yank): Update docstring for change in default value
  of org-yank-adjusted-subtrees.

The default value was changed to nil in 2949012 (Change default values
of some variables., 2009-02-01).

Reported-by: Jorge Peixoto de Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106610>
2016-04-23 17:38:45 -04:00
Nicolas Goaziou 7e320e2f1b ob-emacs-lisp: Defaut binding is dynamic
* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
  Change default value.

<http://permalink.gmane.org/gmane.emacs.orgmode/106530>
2016-04-20 23:45:32 +02:00
Nicolas Goaziou 466d044a9b org-bibtex: Fix curly braces removal
* lisp/org-bibtex.el (org-bibtex-read): Only remove one level of curly
  braces when parsing an entry.

Reported-by: timor <timor.dd@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106495>
2016-04-20 22:59:55 +02:00
Oleh Krehel 7dd0d7a567 Avoid "Marker points into wrong buffer"
* lisp/org-indent.el (org-indent-initialize-buffer): Add a check.  The
bug occurred when trying to capture before any Org buffers were open.
2016-04-20 17:22:09 +02:00
Oleh Krehel 8614a2476f Add detailed location to "org-mode fontification error"
* lisp/org.el (org-fontify-meta-lines-and-blocks): Update.
2016-04-20 17:22:09 +02:00
Oleh Krehel e85f80e2f8 lisp/org-agenda.el (org-agenda-run-series): Prettify 2016-04-20 17:22:09 +02:00
John Kitchin 516bbf417c ob-emacs-lisp: Make lexical eval default for elisp src blocks
* lisp/ob-emacs-lisp.el (org-babel-header-args:emacs-lisp):
(org-babel-default-header-args:emacs-lisp): New variables.
(org-babel-execute:emacs-lisp): Add an optional argument to the eval
function.
2016-04-19 21:40:21 +02:00
Nicolas Goaziou b2411769cf Merge branch 'maint' 2016-04-19 21:31:30 +02:00
Nicolas Goaziou 21ef130752 ox-odt: Fix styles location
* lisp/ox-odt.el (org-odt-styles-dir-list): Point to correct location
  for styles.

Reported-by: Colin Baxter <m43cap@yandex.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106209>
2016-04-19 21:30:39 +02:00
Nicolas Goaziou dbda42010c org-agenda: Fix "Void variable org-clock-current-task"
* lisp/org-agenda.el (org-agenda-mark-clocking-task):
(org-agenda-clock-goto): `org-clock-current-task' may not be defined, so
check that first.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106504>
2016-04-19 21:14:54 +02:00
Nicolas Goaziou 7894129841 Merge branch 'maint' 2016-04-19 01:37:50 +02:00
Nicolas Goaziou 77b4fad528 Remove duplicate candidates when setting tags
* lisp/org.el (org-set-tags): Remove duplicate candidates from menu.
2016-04-19 01:34:27 +02:00
Nicolas Goaziou 2a49038fd6 org-pcomplete: Fix TAGS completion
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags):
(pcomplete/org-mode/tag): Use new `org-current-tag-alist' instead of
`org-tag-alist' so as to take `org-tag-persistent-alist' into
consideration.
2016-04-18 19:34:08 +02:00
Nicolas Goaziou 9297757fc0 Fix tag related defcustoms
* lisp/org.el (org-tag-alist):
(org-tag-persistent-alist): Improve docstring. Fix values.
2016-04-18 18:08:53 +02:00
Nicolas Goaziou 4743d43dd8 Properly handle `org-tag-persistent-alist'
* lisp/org.el (org-current-tag-alist): New variable.
(org-set-tags):
(org-global-tags-completion-table):
(org-agenda-prepare-buffers): Use new variable.
(org-set-regexps-and-options): Use new variable.  Handle STARTUP early
so that "#+STARTUP: noptag" is taken into consideration.

* lisp/org-agenda.el (org-agenda-bulk-action): Use new variable.

* lisp/org-mobile.el (org-mobile-create-index-file): `org-tag-alist' is
  no longer buffer-local.

* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
  tests.
2016-04-18 18:07:40 +02:00
Nicolas Goaziou 74d3bd484f Factorize tags parsing
* lisp/org.el (org-tag-string-to-alist):
(org-tag-alist-to-string):
(org-tag-alist-to-groups): New functions.
(org-set-regexps-and-options): Use new functions.

(org--setup-process-tags): Remove function.

(org--setup-collect-keywords): Return tag groups as a string instead of
a list so as to be compatible with new functions.

* lisp/org-mobile.el (org-mobile-create-index-file): Use new functions.

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags): Use new
  functions.
(pcomplete/org-mode/tag): Small refactoring.

* testing/lisp/test-org.el (test-org/tag-string-to-alist):
(test-org/tag-alist-to-string):
(test-org/tag-alist-to-groups): New tests.
2016-04-18 17:40:15 +02:00
Nicolas Goaziou d87158ba2a Merge branch 'maint' 2016-04-16 11:38:25 +02:00
Nicolas Goaziou e0acd8a15a Fix "Invalid time zone specification" error
* lisp/org.el (org-timestamp-change): Correctly handle `encode-time'
  parameters.

Suggested-by: Derek Feichtinger <dfeich@gmail.com>
Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/106344>
2016-04-16 11:35:43 +02:00
Nicolas Goaziou 9314380284 Merge branch 'maint' 2016-04-14 09:18:00 +02:00
Nicolas Goaziou 846467b718 Fix typo
* lisp/org.el (org-property--local-values): Fix typo in doc string.
2016-04-14 09:17:34 +02:00
Nicolas Goaziou 3135d24239 ox-ascii: Small refactoring
* lisp/ox-ascii.el (org-ascii--describe-links): Small refactoring.
2016-04-13 23:50:15 +02:00
Nicolas Goaziou 602fca424d Merge branch 'maint' 2016-04-13 23:48:27 +02:00
Nicolas Goaziou 297315c46a org-capture: Fix invalid table line specification
* lisp/org-capture.el (org-capture-place-table-line): Move point in
  front of the table before trying to analyze it.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106356>
2016-04-13 23:47:36 +02:00
Nicolas Goaziou 2aa7c34bb5 ob-lisp: Fix error when evaluating a lisp src-block
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Change values to functions
  instead of strings.
(org-babel-execute:lisp): Apply change.
2016-04-13 23:29:41 +02:00
Nicolas Goaziou a57a93e3f6 Merge branch 'maint' 2016-04-13 23:18:29 +02:00
Nicolas Goaziou 9b5f2a03ea ox-ascii: Fix export of links in headlines
* lisp/ox-ascii.el (org-ascii--unique-links):
(org-ascii-headline):
(org-ascii-section): Fix export of links in headlines.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106338>
2016-04-13 23:16:25 +02:00
Nicolas Goaziou 1581da82be ob-lisp: Default evaluator is SLIME
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Set default value to
  "slime-eval".
2016-04-12 22:12:11 +02:00
Nick Dokos 476211ac73 ob-lisp: Fix typo in doc string
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Fix typo.
2016-04-12 22:10:54 +02:00
Kyle Meyer 634e12a31e Merge branch 'maint' 2016-04-11 00:32:43 -04:00
Kyle Meyer acfd411193 Update format-time-string calls for argument change
* lisp/org.el (org-timestamp-format):
* lisp/ox-icalendar.el (org-icalendar-convert-timestamp): Specify t for
  the ZONE argument of format-time-string to indicate UTC.

As of Emacs's af32fa9 (New optional ZONE arg for format-time-string
etc., 2015-07-26), UTC is indicated by passing t as the third argument
to format-time-string rather than any non-nil value.

This change is in place of a backport of Emacs's b787d55 (More
format-time-string change fixups, 2016-04-02), which would not work for
earlier versions of Emacs.
2016-04-11 00:32:08 -04:00
Nicolas Goaziou 492d68c936 Add ODT to default export back-ends
* lisp/org.el (org-export-backends): Add `odt' to default value.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/106198>
2016-04-10 10:22:38 +02:00
Erik Hetzner f97317abcb org-attach: Use relative path for git annex
* lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
  argument for git annex.  Fixes error in test with version 3 of git
  annex.
2016-04-10 10:13:57 +02:00
stardiviner d79835a821 ob-lisp: Add SLY support
* ob-lisp.el (org-babel-lisp-eval-fn): New variable.
(org-babel-execute:lisp): Support using SLY to evaluate lisp src block.

Let user can evaluate Lisp src block with SLY.

Modified from a patch proposal by stardiviner.

TINYCHANGE
2016-04-10 10:07:38 +02:00
Michael Strey 0fac70ea89 org.el: Fix bug from switch to lexical binding
* lisp/org.el (org-check-dates-range): Fix a bug introduces with the
  switch to lexical binding in commit
  1f49e9fdfd.

This change fixed the following bug:  C-c \ D leads to error message "Symbol's value as variable is void: start-date".

TINYCHANGE
2016-04-08 23:12:42 +02:00
Nicolas Goaziou 4bc07758a5 Merge branch 'maint' 2016-04-06 22:28:16 +02:00
Nicolas Goaziou 9c6811b9d4 ox-texinfo: Fix erroneous count of blank lines in menu
* lisp/ox-texinfo.el (org-texinfo-section):
(org-texinfo--build-menu): Normalize empty lines in generated menu.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://permalink.gmane.org/gmane.emacs.orgmode/106145>
2016-04-06 22:26:42 +02:00
Nicolas Goaziou 716e339c96 Allow angular links within link descriptions
* lisp/org-element.el (org-element-object-restrictions):
(org-element--object-lex): Allow angular links as equivalent to plain
links in description.

* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.
2016-04-06 11:08:53 +02:00
Nicolas Goaziou 64ca6f2c24 Keep headlines named like current one in refile targets
* lisp/org.el (org-refile-get-targets): Change signature.
(org-refile-get-location): Change signature.  Also apply change above.
(org-goto):
(org-refile): Apply change above.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106051>
2016-04-05 23:45:37 +02:00
Nicolas Goaziou 0e0a72443a org-agenda: Fix Invalid Function 4 error
* lisp/org-agenda.el (org-tags-view): Fix wrong conversion introduced in
  commit a02a83793b.

Reported-by: Ian Dunn <dunni@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/106080>
2016-04-05 23:31:21 +02:00
Nicolas Goaziou f07580066e ox-html: Silence byte-compiler 2016-03-30 17:18:47 +02:00
Nicolas Goaziou 3149a01513 Merge branch 'maint' 2016-03-30 17:17:51 +02:00
Nicolas Goaziou cb683e3a56 ox-html: Fix planning info export
* lisp/ox-html.el (org-html-planning): Properly escape angle brackets in
  time-stamps.

Reported-by: Keith Sutton <kesutt@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105945>
2016-03-30 17:17:07 +02:00
John Kitchin d5b9c74430 ox-html: Add html attributes to special blocks
* lisp/ox-html.el (org-html-special-block): enables #+attr_html and puts
  an id in when the special block is named.
2016-03-30 17:01:12 +02:00
John Kitchin 8f4f7dfd14 ox-html: Add html attributes to quote-block
* lisp/ox-html.el (org-html-quote-block): Enables #+attr_html: and puts
  a id attribute when the block is named into the html element.
2016-03-30 16:38:53 +02:00
John Kitchin 2ce1fc2c0d ox-html: Add id attribute to example-block on html export
* lisp/ox-html.el (org-html-example-block): Add "id" attribute according
  to name.

This allows you to hyperlink to the block.
2016-03-30 16:16:12 +02:00
Richard Kim 8e1c2a39f3 org-info.el: Generate HTML links to gnu.org
* lisp/org-info.el (org-info-export): Convert info links to HTML URL's
that point to appropriate gnu.org or other pages.  User's can customize
the behavior using `org-info-emacs-documents' and
`org-info-other-documets' new variables.

TINYCHANGE
2016-03-30 15:56:02 +02:00
Nicolas Goaziou ff236e5c85 Merge branch 'maint' 2016-03-30 15:36:16 +02:00
Nicolas Goaziou 954103dd9b Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Return correct columns
  when at the end of an empty item.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-30 15:34:24 +02:00
Nicolas Goaziou 0f512848ea Merge branch 'maint' 2016-03-28 11:07:27 +02:00
Nicolas Goaziou a94147535a ox-html: Fix Usenet links
* lisp/ox-html.el (org-html-link): Properly export Usenet links.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/105915>
2016-03-28 11:06:56 +02:00
Thierry Banel 9438ac6014 ob-C: Add :libs to babel C++
* lisp/ob-C.el (org-babel-C-execute): add support for :libs header
  parameter to specify libraries to link with.
2016-03-26 00:32:56 +01:00
Nicolas Goaziou 6cddbe8493 Merge branch 'maint' 2016-03-26 00:29:20 +01:00
Thierry Banel f9464d2678 ob-C: use size_t in babel D
* lisp/ob-C.el (org-babel-C-header-to-C): change ulong to size_t for
  indexing a table as mandated by the latest version of the D language
  (thanks to Chris Andrews)
2016-03-26 00:27:39 +01:00
Nicolas Goaziou 6f543959ed Merge branch 'maint' 2016-03-26 00:20:47 +01:00
Nicolas Goaziou 28a8d2e24e org-table: Fix docstrings
* lisp/org-table.el (org-table-eval-formula): Nowadays, Calc is
  installed with Emacs, so there is no need to specify this.  Also
  remove hard-coded "C-u".
(org-table-recalculate): Fix code typo.
2016-03-25 23:11:34 +01:00
Nicolas Goaziou 0b077de733 org-table: Fix #ERROR in table formula with "@>"
* lisp/org-table.el (org-table-eval-formula): Expand first and last
  references into proper fields coordinates before replacing ranges.

Reported-by: Pablo S. Casas <pabloscasas@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105895>
2016-03-25 22:33:06 +01:00
Nicolas Goaziou 2afce8b22f Merge branch 'maint' 2016-03-24 22:13:27 +01:00
Nicolas Goaziou 6d070db91c org-table: Silence byte-compiler 2016-03-24 22:12:58 +01:00
Nicolas Goaziou 0fd7fd072e Merge branch 'maint' 2016-03-24 14:00:44 +01:00
Nicolas Goaziou a5623bc502 org-table: Fix LaTeX snippets in radio tables
* lisp/org-table.el (orgtbl-to-generic): Call back-end specific filters.
* testing/lisp/test-org-table.el (test-org-table/to-latex): Add test.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/105876>
2016-03-24 13:59:29 +01:00
Oleh Krehel 809a838844 org-agenda.el (org-agenda-to-appt): Don't echo already added
`appt-add' returns nil when the event was already added previously.
2016-03-18 15:23:52 +01:00
Marcin Borkowski ebd68ae499 Enhance year handling
* lisp/org.el (org-read-date-analyze): Handle two-digit years with
`org-small-year-to-year' instead of just adding 2000
2016-03-18 14:31:07 +01:00
Nicolas Goaziou bf40aba6cd Merge branch 'maint' 2016-03-17 16:51:43 +01:00
Nicolas Goaziou 261eadb9d4 Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-17 16:50:54 +01:00
Nicolas Goaziou 1d781b3365 Use Babel cache when exporting src blocks
* lisp/ob-core.el (org-babel-process-params): Normalize return value.
* testing/lisp/test-ob.el (test-ob/process-params-no-duplicates): Fix
  test.
2016-03-17 00:23:02 +01:00
Nicolas Goaziou 99e12cbf92 Merge branch 'maint' 2016-03-16 22:08:35 +01:00
Nicolas Goaziou 9c2e8a7988 org-agenda: Fix bulk re-scheduling
* lisp/org-agenda.el (org-agenda-bulk-action): Fix rescheduling TODO items with `org-log-reschedule' set to `note'.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://permalink.gmane.org/gmane.emacs.orgmode/105591>
2016-03-16 22:07:16 +01:00
Nicolas Goaziou dcfe011998 org-element: Fix inline src block parsing
* lisp/org-element.el (org-element--pair-curly-table): Fix typo.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add tests.

Reported-by: William Denton <wtd@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105748>
2016-03-16 18:15:39 +01:00
Nicolas Goaziou 1795d505e8 ox-html: Fix code comment
* lisp/ox-html.el (org-html-link): Radio-targets are not meant to be
  resolved through cross-referencing.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 5563682ca6 ox-publish: Keep code within 80 columns
* lisp/ox-publish.el (org-publish-write-cache-file):
(org-publish-initialize-cache): Keep code within 80 columns.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou bef3fc6f82 ox-publish: Better handling of cross-references
* lisp/ox-publish.el (org-publish--collect-references): Renamed...
(org-publish--store-crossrefs): ... to this.
(org-publish-org-to): Use previous function.  Small refactoring.

(org-publish-resolve-external-link): Use tight integration with
`org-export-get-reference' so as to provide reliable cross references.

* lisp/ox.el (org-export-get-reference): Conversely, take into
  consideration references suggested by
  `org-publish-resolve-external-link'.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 32c3f33d00 ox: Use a new scheme for internal references
* lisp/ox.el (org-export-get-reference): Use randomly generated labels.
(org-export-new-reference):
(org-export-format-reference): New functions.

* testing/lisp/test-ox.el (test-org-export/get-reference): New test.

The new scheme is better when datum type cannot be known ahead of time
or when references are not created sequentially, e.g., during
a publishing process where a reference to a file can be require before
the file is published.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 6ec06dcff9 ox: Abstract fuzzy link searches with search cells
* lisp/ox.el (org-export-search-cells):
(org-export-string-to-search-cell):
(org-export-match-search-cell-p): New functions.

(org-export-resolve-fuzzy-link): Use new functions.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Tiny
  refactoring.
(test-org-export/resolve-fuzzy-link): Fix failing test.
2016-03-12 23:18:55 +01:00
Kyle Meyer 015d971f48 Merge branch 'maint' 2016-03-12 11:12:08 -05:00
Kyle Meyer dd9be3a6ea Fix docstring typo
* lisp/org.el (org-align-all-tags): Fix typo in docstring.
2016-03-12 11:11:18 -05:00
Kyle Meyer dade0d5b28 Merge branch 'maint' 2016-03-11 22:51:07 -05:00
Kaushal Modi ebacca39b4 Display quotes in key-bindings as straight quotes
* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas): Fix straight quotes
  rendered as curvy quotes in echoes messages (in emacs 25.1).
* lisp/org-table.el (org-table-align): Fix straight quotes rendered as
  curvy quotes in help echo (in emacs 25.1).

* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting.

The below thread discusses why these changes were needed especially when
using emacs 25.1 or newer emacsen (that added support for rendering
back-quotes and straight quotes as left/right curvy quotes by default):
http://thread.gmane.org/gmane.emacs.orgmode/105594

Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).

So below will render that single quote as curly.

(message "C-c '")

The fix (Reference:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00234.html)
is to print that quote verbatim using the "%s" modifier:

(message "%s" "C-c '")

Also an help-echo text property value was fixed in `org-table-align'.
`substitute-command-keys' should not be used in that.  Instead \\[COMMAND]
should be used directly in the string.
2016-03-11 22:40:30 -05:00
Nicolas Goaziou 0b59a5994e Merge branch 'maint' 2016-03-10 10:11:24 +01:00
Nicolas Goaziou 5a735b0b80 ox: Fix smart quotes within tables
* lisp/ox.el (org-export--smart-quote-status): Handle smart quotes
  within objects.

* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes): Add
  tests.

Reported-by: Philipp Middendorf <pmi@hacon.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105586>
2016-03-10 10:10:29 +01:00
Nicolas Goaziou d5a603db1f Merge branch 'maint' 2016-03-10 09:54:52 +01:00
Nicolas Goaziou cb5f323b0d org-crypt: Decrypt entries with a properties drawer
* lisp/org-crypt.el (org-decrypt-entry): Decrypt entries with
  a properties drawer.

This commit propagates changes made to `org-encrypt-entry' in the
previous commit.
2016-03-10 09:52:53 +01:00
Nicolas Goaziou b43898a237 Merge branch 'maint' 2016-03-10 09:50:49 +01:00
Nicolas Goaziou 11d2b3c3f8 org-crypt: Do not encrypt properties drawers
* lisp/org-crypt.el (org-encrypt-entry): Do not encrypt properties
  drawer, as specified in the manual.

Reported-by: "Daniel E. Doherty" <ded@ddoherty.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/105587>
2016-03-10 09:43:36 +01:00
Kyle Meyer 1376123dea Merge branch 'maint' 2016-03-01 23:32:22 -05:00
Kyle Meyer be5452b126 org-eval-in-calendar: Fix docstring
* lisp/org.el (org-eval-in-calendar): Fix docstring's description of
  KEEPDATE.
2016-03-01 23:31:49 -05:00
Nicolas Goaziou 194b754597 Merge branch 'maint' 2016-03-01 01:06:02 +01:00
Nicolas Goaziou 105a446697 Fix return value for `org-get-outline-path'
* lisp/org.el (org--get-outline-path-1): Replace links with their
description, or path, in addition to removing statistics cookies.
(org-get-outline-path): Add an optional argument to include current
headline in path.
(org-refile-get-targets): Make use of new argument.  Remove call to
`org-link-display-format', which is now handled in
`org--get-outline-path-1'.

* testing/lisp/test-org.el (test-org/get-outline-path): Add tests.

Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105425>
2016-03-01 01:01:07 +01:00
Nicolas Goaziou cec775fa06 Merge branch 'maint' 2016-02-29 16:27:19 +01:00
Nicolas Goaziou 2971ab6126 Fix `org-get-outline-path'
* lisp/org.el (org--get-outline-path-1): Fix wrong type arrayp error
  when trying to get the outline path of an empty headline.
* testing/lisp/test-org.el (test-org/get-outline-path): Add test.

Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105407>
2016-02-29 16:25:24 +01:00
Nicolas Goaziou b62d55cbb6 org-footnote: Fix failing test
* lisp/org-footnote.el (org-footnote-normalize): Fix failing test due to
  missing `incf' function.
2016-02-28 12:09:30 +01:00
Nicolas Goaziou ae0d9fbb09 org-footnote: Handle un-referenced definitions
* lisp/org-footnote.el (org-footnote-sort):
(org-footnote-normalize): Insert un-referenced definitions upon sorting.

* testing/lisp/test-org-footnote.el (test-org-footnote/sort):
(test-org-footnote/normalize): Add tests.
2016-02-27 16:05:35 +01:00
Nicolas Goaziou 2a0a37c1a7 Merge branch 'maint' 2016-02-27 09:35:30 +01:00
Nicolas Goaziou dc68d28d67 ox-latex: Remove spurious newline in labels
* lisp/ox-latex.el (org-latex--caption/label-string): Remove spurious
  newline in labels.

Reported-by: Thomas S. Dye <tsd@tsdye.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105356>
2016-02-27 09:34:45 +01:00
Nicolas Goaziou 07e514b58b org-colview: Fix :id in columnview
* lisp/org-colview.el (org-dblock-write:columnview): Fix typo in pcase
  so ID are properly recognized in current document.

* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add tests.
2016-02-27 09:25:01 +01:00
Nicolas Goaziou 7bcd3e6a79 ox-latex: Remove trailing white space
* lisp/ox-latex.el (org-latex-custom-lang-environments): Remove trailing
  white space in docstring.
2016-02-26 20:47:16 +01:00
Nicolas Goaziou e4d196758b Merge branch 'master' of orgmode.org:org-mode 2016-02-26 20:00:43 +01:00
Oleh Krehel 1003b1025b org-agenda.el (org-agenda-to-appt): Ignore DONE tasks 2016-02-26 16:58:44 +01:00
Nicolas Goaziou 28d3e729e4 org-mobile: Fix Wrong type argument: sequencep, :startgrouptag
* lisp/org-mobile.el (org-mobile-create-index-file): Handle group tags.

Reported-by: John Hutchinson <johnrhutchinson@att.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/105033>
2016-02-26 16:34:53 +01:00
Nicolas Goaziou 7125fa1947 Merge branch 'maint' 2016-02-25 18:16:58 +01:00
Nicolas Goaziou a0047bcd47 Fix `org-link-display-format'
* lisp/org.el (org-link-display-format): Replace all links in give
  string instead of the first one only.
2016-02-25 18:10:24 +01:00
Nicolas Goaziou d7d0b2725d ob-core: Remove useless code
* lisp/ob-core.el (org-babel-where-is-src-block-result): Remove useless
  code introduced in last ob-core.el commit.
2016-02-25 18:03:30 +01:00
Nicolas Goaziou 44db364c69 Merge branch 'maint' 2016-02-25 15:11:02 +01:00
Nicolas Goaziou 642c50f0cb Silence byte-compiler 2016-02-25 15:10:49 +01:00
Nicolas Goaziou 0f3cb188a9 ob-core: Fix Invalid search bound (wrong side of point)
* lisp/ob-core.el (org-babel-where-is-src-block-result): Return nil when
  anonymous results would be located outside of the container of the
  source block.

* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): Add test.

Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105309>
2016-02-25 14:53:00 +01:00
Nicolas Goaziou 5660047846 Merge branch 'maint' 2016-02-25 14:42:22 +01:00
Nicolas Goaziou 54b42f7e59 Tiny refactoring
* lisp/org.el (org-refile-get-targets): Tiny refactoring.
2016-02-25 14:41:54 +01:00
Nicolas Goaziou 2db95a7755 Merge branch 'maint' 2016-02-25 14:41:08 +01:00
Nicolas Goaziou 66fbceb727 Fix `org-refile-get-targets'
* lisp/org.el (org-refile-get-targets): Fix bug when using
  `org-refile-target-verify-function'.  Improve speed.

(org-olpa): Remove variable.
(org-outline-path-cache): New variable.

(org--get-outline-path-1): New function.
(org-get-outline-path): Use new function.  This fixes return value when
cache is used and calls are not in the same path.

* testing/lisp/test-org.el (test-org/get-outline-path): New test.

Reported-by: Florian Adamsky <fa-org-mode@haktar.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/104829>
2016-02-25 14:32:57 +01:00
Nicolas Goaziou 86bc987ca1 org-colview: Remove `org-columns-spec' property
* lisp/org-colview.el (org-columns--display-here): Remove unnecessary
  `org-columns-spec' property.
(org-columns-update): Use (current-column) to extract column format
specifications.
2016-02-25 00:36:05 +01:00
Nicolas Goaziou 71d734f399 org-colview: Prevent computing again values in some cases
* lisp/org-colview.el (org-columns-delete):
(org-columns-widen): Do not recompute value.
2016-02-25 00:33:28 +01:00
Nicolas Goaziou 41d005822e Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation bug.
* testing/lisp/test-org.el (test-org/indent-line): Add test.

In the following document, the last line would be indented to "|"

- item

  #+BEGIN_SRC emacs-lisp
    (+ 1 1)
  #+END_SRC
    |
2016-02-24 20:58:55 +01:00
Nicolas Goaziou 1f84cc2182 org-colview: Silence byte-compiler 2016-02-24 00:53:27 +01:00
Nicolas Goaziou 099d84c76d org-colview: Fix editing values altering headings
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-next-allowed-value): Make sure overlays are still in place
when a property altering current headline is modified.  Refactor code.
Do not limit allowed values to 10.

* testing/lisp/test-org-colview.el (test-org-colview/columns-next-allowed-value):
New test.
2016-02-23 22:32:47 +01:00
Nicolas Goaziou a4ad618f62 org-colview: Fix `org-columns-view' and `org-columns-edit-value'
* lisp/org-colview.el (org-columns-new): Change signature to allow both
  editing and column creation non-interactively.
(org-columns-edit-attributes): Use new signature.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new):
  Update tests.
2016-02-23 17:36:48 +01:00
Nicolas Goaziou acef7d8a43 org-colview: Do not compute values swapping columns
* lisp/org-colview.el (org-columns-move-right): Do not compute values
  swapping columns.  Comment about a corner case.

* testing/lisp/test-org-colview.el (test-org-colview/columns-move-left):
(test-org-colview/columns-move-right): New tests.
2016-02-23 17:36:41 +01:00
Nicolas Goaziou 14d81d38e0 org-colview: Fix columns format extraction
* lisp/org-colview.el (org-columns-get-format): Do not assume
  `org-columns-default-format' contains valid columns format.  Look for
  COLUMNS keyword if necessary.
(org-columns-quit): Reset `org-columns-current-fmt'.
(org-columns-redo): Provide `org-columns-current-fmt' as the active
format so as to avoid extracting it again.

* testing/lisp/test-org-colview.el (test-org-colview/get-format): New
  test.
2016-02-23 15:20:02 +01:00
Nicolas Goaziou ab38d15186 org-colview: Tiny refactoring
* lisp/org-colview.el (org-columns--collect-values): Tiny refactoring.
2016-02-23 15:19:59 +01:00
Nicolas Goaziou 0de85fca9e org-colview: Remove `org-computed' property
* lisp/org-colview.el (org-columns-check-computed): Check if current
  column contains an operator instead of looking for an `org-computed'
  text property.
(org-columns--compute-spec): Do not apply `org-computed' text property.
2016-02-23 14:07:36 +01:00
Nicolas Goaziou d7fbad1a81 org-colview: Rename `org-columns-new-overlay'
* lisp/org-colview.el (org-columns-new-overlay): Rename this to...
(org-columns--new-overlay): ... this.
(org-columns--display-here): Apply renaming.
2016-02-23 14:07:36 +01:00
Nicolas Goaziou 24033e3c67 Move `org-edit-headline'
* lisp/org-colview.el (org-edit-headline): Move from here...
* lisp/org.el (org-edit-headline): ... to here.  Also refactor code.
  Accept to set headline non-interactively.

* testing/lisp/test-org.el (test-org/edit-headline): New test.
2016-02-23 14:07:32 +01:00
Nicolas Goaziou 7c0618b04d org-colview: Fix COLUMNS keyword update
* lisp/org-colview.el (org-columns-store-format): Make sure we're really
  at a COLUMNS keyword before replacing it.  Also replace only the first
  one, not all of them.

* testing/lisp/test-org-colview.el (test-org-colview/columns-new): Add
  tests.
2016-02-23 13:18:38 +01:00
Nicolas Goaziou de439a68c8 org-colview: Allow multiple summaries for a single property
* lisp/org-colview.el (org-columns--collect-values):
(org-agenda-colview-summarize): Use column format specification as the
  unique identifier for the returned alist.

* lisp/org-colview.el (org-columns--display-here): Store column format
  specification in a new overlay property.

(org-columns--set-widths):
(org-columns--display-here): Use column format specification instead of
(org-columns--displayed-value): Since the same property can have
multiple titles, use column specification instead of property as keys.

(org-columns--collect-values): Apply signature change.

(org-columns-update): Handle multiple columns for the same property.
Also apply signature change to `org-columns--displayed-value'.

(org-columns--compute-spec): New function.
(org-columns-compute):
(org-columns-compute-all): Use new function.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
(test-org-colview/columns-update): Add tests.

* doc/org.texi (Column attributes): Document computation with multiple
  summary types for a given property.
2016-02-23 13:18:34 +01:00
Nicolas Goaziou 633e4d4202 org-colview: Remove summarize function from format spec
* lisp/org-colview.el (org-columns--summarize): Throw an error when no
  summarize function is associated to a given operator.

(org-columns-compile-format): Do not provide summarize function, which
can be found using the accessor `org-columns--summarize'.

(org-columns-new):
(org-columns-uncompile-format):
(org-columns-compute):
(org-columns-compute-all):
(org-agenda-colview-summarize): Use new compiled format.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou 9dfe3d8079 org-colview: Make `org-columns-current-maxwidths' a vector
* lisp/org-colview.el (org-columns-current-maxwidths): Update docstring.
(org-columns--autowidth-alist): Rename to...
(org-columns--set-widths): ... this.
(org-columns--display-here):
(org-columns--display-here-title):
(org-columns-widen):
(org-columns-update): Use new type.

(org-columns):
(org-agenda-columns): Apply renaming.

* testing/lisp/test-org-colview.el (test-org-colview/columns-width):
  Update test.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou ebf7bbb308 org-colview: Store properties in upper case
* lisp/org-colview.el (org-columns-compile-format): Property is
  upper-cased.  Title is not, however.
(org-columns--displayed-value):
(org-columns--collect-values):
(org-columns--autowidth-alist):
(org-columns--overlay-text):
(org-columns--display-here):
(org-columns--display-here-title):
(org-columns-next-allowed-value):
(org-columns):
(org-columns-widen):
(org-columns-update):
(org-columns--capture-view):
(org-dblock-write:columnview):
(org-agenda-colview-summarize): Since properties in compiled format are
upper-cased, remove the `upcase' or `assoc-string' dance.

* testing/lisp/test-org-colview.el (test-org-colview/columns-new):
(test-org-colview/columns-update): Add case-sensitivity tests.

`assoc-string' is still necessary in functions where property is
provided by the user, e.g. `org-columns-update'.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou 92443160fd ox-publish: Write cache after successfully publishing a file
* lisp/ox-publish.el (org-publish-file): Ignore NO-CACHE parameter when
  writing cache to file.  This is needed to recover from an interrupted
  publishing process.

Reported-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/105046>
2016-02-22 21:53:42 +01:00
Michael Brand 54b4be8208 orgstruct: Add `org-force-cycle-archived'
* lisp/org.el (orgstruct-setup): Add `org-force-cycle-archived' to the
list of the functions to be hijacked.
2016-02-22 20:53:48 +01:00
Aaron Ecay 84e3f23b9a ob-core: remove cruft
* lisp/ob-core.el (org-babel-execute-src-block): Simplify.
(org-babel-tramp-handle-call-process-region): Remove.

Commit 57104f9f changed an org-flet to a let, rendering the whole
apparatus of modifying call-process-region inoperative.  Supposedly this
was put in place to work around a bug in
tramp-handle-call-process-region, which was removed from tramp in
2012 (after being renamed to tramp-sh-call-process-region).  *shrug*
This commit just removes the whole thing.

It also no longer consults ‘org-src-lang-modes’, following on from
commit 6287416.
2016-02-22 16:04:08 +00:00
Aaron Ecay 848a87634d Add org-babel-make-language-alias function.
* lisp/ob-core.el (org-babel-make-language-alias): New function.
* lisp/ob-emacs-lisp.el: Use it.

Previously this was accomplished via org-src-lang-modes, but that is a
poor solution, as it conflates the remapping of language mode names with
the creation of aliases.
2016-02-22 16:04:03 +00:00
Nicolas Goaziou a311a85651 Merge branch 'maint' 2016-02-22 09:41:25 +01:00
Jason Furtney 1045e9e9c0 org.el: Fix typo in `org-previous-visible-heading'
* lisp/org.el (org-previous-visible-heading): Fix docstring.

TINYCHANGE
2016-02-22 09:40:37 +01:00
Nicolas Goaziou 2b3c72e231 org-colview: Fix failing test
* lisp/org-colview.el (org-columns-new): Tiny refactoring.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new): Fix
  typo in test.
2016-02-21 20:21:48 +01:00
Nicolas Goaziou a16eba2a02 Fix `org-compute-property-at-point'
* lisp/org.el (org-compute-property-at-point): Properties are
  case-insensitive.
2016-02-21 15:58:11 +01:00
Nicolas Goaziou b386089ee6 org-colview: Fix `org-columns-new'
* lisp/org-colview.el (org-columns-new): Fix location of inserted
  column.  Properly handle non-interactive cases.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new): New
  test.
2016-02-21 14:59:52 +01:00
Nicolas Goaziou cd5eb50fd1 org-colview: Fix CLOCKSUM and CLOCKSUM_T summaries
* lisp/org-colview.el (org-columns--summarize): New function.
(org-columns-new):
(org-columns-compile-format): Use new function.
(org-agenda-colview-summarize): Use new function.  Fix return value for
CLOCKSUM and CLOCKSUM_T.
2016-02-21 14:22:23 +01:00
Nicolas Goaziou fedd6be97a org-colview: Introduce custom summary types
* lisp/org-colview.el (org-columns-summary-types): New variable.
(org-columns-compile-map): Rename into...
(org-columns-summary-types-default): ... this.

(org-columns-new):
(org-columns-compile-format): Use new variables.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add test.

* doc/org.texi (Column attributes): Document new variable.  Improve
  description of time and age based summary types.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 15101fe7a6 org-colview: Remove now useless functions
* lisp/org-colview.el (org-columns-number-to-string):
(org-columns-string-to-number): Remove functions.

(org-columns--displayed-value): Apply removal.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 58d387661a org-colview: Rationalize summary process
* lisp/org-colview.el (org-columns-compile-map): Externalize summary
  functions.  Remove "none" summary.
(org-columns-new): Apply previous removal.

(org-columns--fractional-duration-re): Rename variable to...
(org-columns--duration-re): ... this.

(org-columns-compute): Change how values are computed.  This is now done
in one pass.  A summarize function is given a list of strings and
possible a format string.  It has to return the computed value as
a string.

(org-columns--time-to-seconds):
(org-columns--age-to-seconds):
(org-columns--summary-apply-times):
(org-columns--summary-sum):
(org-columns--summary-currencies):
(org-columns--summary-checkbox):
(org-columns--summary-checkbox-count):
(org-columns--summary-checkbox-percent):
(org-columns--summary-min):
(org-columns--summary-max):
(org-columns--summary-mean):
(org-columns--summary-sum-times):
(org-columns--summary-min-time):
(org-columns--summary-max-time):
(org-columns--summary-mean-time):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): New functions.

(org-columns--summary-estimate):
(org-agenda-colview-summarize): Update functions to new process.

(org-columns-string-to-number): Apply variable renaming.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Fix test.  Add some more.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 5c0a927990 org-colview: Move summary functions in a dedicated section 2016-02-21 00:44:17 +01:00
Nicolas Goaziou 58777b8200 org-colview: Remove unusued format attribute
* lisp/org-colview.el (org-columns-compile-map):
(org-columns-compile-format): Remove unused "format" attribute.

(org-columns--displayed-value):
(org-columns-new):
(org-columns-compute):
(org-columns-uncompile-format):
(org-agenda-colview-summarize): Apply removal.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou d59d96efaa org-colview: Ignore "fmt" format property
* lisp/org-colview.el (org-columns--displayed-value):
(org-columns-next-allowed-value):
(org-columns-new):
(org-columns-compute):
(org-columns-number-to-string):
(org-columns-string-to-number):
(org-columns-uncompile-format):
(org-columns-compile-format):
(org-agenda-colview-summarize):
(org-agenda-colview-compute): Ignore "fmt" property.  Use "op" instead.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 635161cd3e ob-core: Small refactoring
* lisp/ob-core.el (org-babel-insert-result): Exit early in case of wrong
  parameters used along with inline results.
2016-02-20 00:08:19 +01:00
Nicolas Goaziou 801a66c4b5 ob-core: Tiny refactoring
* lisp/ob-core.el (org-babel-insert-result): Delegate removal of old
  inline results to...
(org-babel-where-is-src-block-result): ... this.

Now `org-babel-where-is-src-block-result' behaves in a symmetric way for
inline an non-inline source blocks.
2016-02-19 23:58:01 +01:00
Nicolas Goaziou e6984bd74b Merge branch 'maint' 2016-02-19 14:29:06 +01:00
Austin Walker 5a193ed485 ox-html.el: Fix TOC export of TODO headlines
* lisp/ox-html.el (org-html--todo): Don't show nil in format string for
  TODO class

Use empty string if :html-todo-kwd-class-prefix is not present.

TINYCHANGE
2016-02-19 14:22:08 +01:00
Nicolas Goaziou a4a6d65c4b ob-core: Fix inline results
* lisp/ob-core.el (org-babel-where-is-src-block-result): Find results
  for inline src-blocks or inline babel call not located on a subsequent
  line, e.g., because of filling.
(org-babel-insert-result): When inline results exist, replace them
in-place.
(org-babel-remove-inline-result): Also remove results not located on the
same line as the source code.
(org-babel-examplify-region): Change signature.  Properly mark inline
results at the beginning of a line.

* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Add tests.
2016-02-18 23:17:15 +01:00
Nicolas Goaziou 323a945366 org-colview: Fix previous commit
* lisp/org-colview.el (org-columns-compute): Fix error introduced in
  last commit.
2016-02-18 13:56:27 +01:00
Nicolas Goaziou 62ec8c0a48 org-colview: Fix `org-columns-compute' with inlinetasks
* lisp/org-colview.el (org-columns-compute): Properly summarize values
  obtained through inline tasks.

* testing/lisp/test-org-colview.el (test-org-colview/columns-update):
  Add test.

Previously, the summary of values from inline tasks was added to to the
summary of values from children.
2016-02-18 11:40:17 +01:00
Nicolas Goaziou ca1fb80dad org-colview: Silence byte-compiler 2016-02-17 23:24:51 +01:00
Nicolas Goaziou 9e3090a5a0 org-colview: Fix `org-columns-update'
* lisp/org-colview.el (org-columns--overlay-text): New function.
(org-columns--display-here): Use new function.
(org-columns-update): Properly handle additional decorations to
displayed values (e.g., ellipses).

* testing/lisp/test-org-colview.el (test-org-colview/columns-update):
  New test.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c158bf2f16 org-colview: Refactor low-high estimates
* lisp/org-colview.el (org-columns-string-to-number):
(org-columns-number-to-string): Handle estimates.

(org-columns-estimate-combine): Rename this to...
(org-columns--estimate-combine): ... this.

(org-columns-compile-map):
(org-columns-compute): Apply renaming.

(org-estimate-mean-and-var):
(org-estimate-print):
(org-string-to-estimate): Remove functions.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c8e7d93bbd org-colview: Remove trailing white space in headers
* lisp/org-colview.el (org-columns--display-here):
(org-columns--display-here-title): Remove trailing white space.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 3debe06bdd Rename `org-insert-columns-dblock' into `org-columns-insert-dblock'
* lisp/org-colview.el (org-columns-dblock-insert): Rename to...
(org-columns-insert-dblock): ... this.  Also fix a bug that would insert
"local" instead of `local' as the :id value.

* lisp/org.el (org-mode-map):
(org-org-menu): Use new name.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 2c974fc8c8 org-colview: Remove unused "calc" operator
* lisp/org-colview.el (org-columns--displayed-value):
(org-columns-compile-map):
(org-columns-compute):
(org-columns-compile-format):
(org-agenda-colview-summarize): Remove "calc" operator.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou aa2db034a0 org-colview: Fix age related summary
* lisp/org-colview.el (org-columns-time): Rename to...
(org--columns-time): ... this.
(org-columns--fractional-duration-re): New variable.

(org-columns-edit-value):
(org-columns):
(org-columns-compute-all):
(org-agenda-columns): Use new variable.

(org-columns-compile-map): Remove unneeded "calc" attribute.

(org-columns-number-to-string):
(org-columns-string-to-number): Fix ages set as a duration (e.g., "1d
12h").  Compare ages as seconds, not number of days.

* doc/org.texi (Column attributes): Document syntax for "age".
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 04c405660d org-colview: Remove unused functions
* lisp/org-colview.el (org-columns-not-in-agenda):
(org-string-to-number): Remove functions.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c551ee4dde org-colview: Fix {X%} summary type
* lisp/org-colview.el (org-columns-compute-all): Small refactoring.
(org-columns-number-to-string): Handle special case of 0 among 0.  Small
refactoring.

(org-nofm-to-completion):
(org-format-time-period): Remove functions.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 470f9fae08 org-colview: Fix capture view
* lisp/org-colview.el (org-columns-capture-view): Rename to...
(org-columns--capture-view): ... this.

(org-dblock-write:columnview): Fix produced table according to new
column view internals.

* lisp/org-colview.el (org-columns--clean-item): New function.

(org-listtable-to-string): Remove function.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 23f1119042 org-colview: Allow to force global column view
* lisp/org-colview.el (org-columns): Add new argument to force global
  column view.

* doc/org.texi (Using column view): Document change.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 279902ca4d org-colview: Fix column width computation
* lisp/org-colview.el (org-columns-current-widths): Remove variable.
(org-columns--value): Remove function.
(org-columns--displayed-value): New function.
(org-columns--collect-values): New function.

(org-columns-display-here): Rename function to...
(org-columns--display-here): ... this.  First argument is now mandatory.

(org-columns-display-here-title): Rename function to...
(org-columns--display-here-title): ... this.

(org-columns-autowidth-alist): Rename function to...
(org-columns--autowidth-alist): ... this.  Remove one argument.

(org-columns-edit-value):
(org-columns-next-allowed-value): Always refresh all columns, not only
the current one.  Otherwise, the current column may end up with
a different width than the others.

(org-columns):
(org-dblock-write:columnview):
(org-agenda-columns):
(org-agenda-colview-summarize): Apply changes above.

Columns width is now computed according to displayed values, not real
ones.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 3196b14342 Make `org-agenda-view-columns-initially' a defcustom
* lisp/org-agenda.el (org-agenda-view-columns-initially): New variable,
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 4eada95883 Move `org-columns-modify-value-for-display-function'
* lisp/org.el (org-columns-modify-value-for-display-function): Move from
  here...
* lisp/org-colview.el (org-columns-modify-value-for-display-function):
  ... to here.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou a5540c5599 org-colview: Remove compatibility cruft
* lisp/org-colview.el (org-verify-version): Remove function.
(org-columns):
(org-agenda-columns): Apply removal.
2016-02-17 22:49:19 +01:00
John Foerch ff98903015 org-attach: Make use of git optional
* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.

TINYCHANGE
2016-02-14 17:56:18 +01:00
Nicolas Goaziou d846817f9d Allow to preview LaTeX fragments in temporary buffers
* lisp/org.el (org-toggle-latex-fragment): Allow to preview fragments
  even when current buffer is not visiting a file.
2016-02-14 00:11:28 +01:00
Nicolas Goaziou caf66ea779 org-colview: Fix columnview table
* lisp/org-colview.el (org-columns-capture-view): Properties are not
  case sensitive.
(org-dblock-write:columnview): Take into consideration stars turned into
spaces (i.e., invisible leading stars) when computing heading level.
Also do not assume "ITEM" is always in the first column of the table.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105051>
2016-02-12 00:43:33 +01:00
Nicolas Goaziou 8eff64cffe Silence byte-compiler
* lisp/org-agenda.el (org-agenda-current-date): New variable.
(org-agenda-get-day-entries):
* lisp/org.el (org-calendar-holiday): Use new variable.
2016-02-11 11:32:14 +01:00
Nicolas Goaziou 5d817df125 Merge branch 'maint' 2016-02-11 09:50:55 +01:00
Nicolas Goaziou 9f737bdf14 org-element: Fix search failed error in `org-element-context'
* lisp/org-element.el (org-element-context): Make sure point is on tag
  line before searching for it.

* testing/lisp/test-org-element.el (test-org-element/context): Add test.
  Small refactoring.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105018>
2016-02-11 09:47:54 +01:00
Alan Schmitt 90ec88d71c ox-coq.el: Clean up
* lisp/ob-coq.el: Create a variable `coq-program-name' and remove unused
  `org-babel-coq-eoe'.

  (org-babel-coq-initiate-session): Use `coq-program-name'.
2016-02-11 08:54:03 +01:00
Nicolas Goaziou 94b78a1198 ob-core: Silence byte-compiler 2016-02-11 00:54:12 +01:00
Nicolas Goaziou ae767704ff Merge branch 'maint' 2016-02-11 00:49:59 +01:00
Nicolas Goaziou 6e88bf07d1 org-archive: Speed-up archiving subtrees
* lisp/org-archive.el (org-toggle-archive-tag): Use `org-flag-subtree',
  which is much faster than outline-hide-subtree'.

Reported-by: Michael Ziems <michael.ziems@xiron.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105005>
2016-02-11 00:47:55 +01:00
Nicolas Goaziou 94dfa7fa9c ob-lob: Improve `org-babel-lob-get-info' consistency
* lisp/ob-lob.el (org-babel-lob-get-info): Make the function on par with
  `org-babel-get-src-block-info' by providing the beginning position of
  Babel code.

(org-babel-lob-execute):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Handle new data.
2016-02-11 00:32:07 +01:00
Nicolas Goaziou a00af53e6e ob: Refactor `org-babel-read-result'
* lisp/ob-core.el (org-babel-read-result): Refactor code.
(org-babel-read-table):
(org-babel-read-list):
(org-babel-read-link): Fix docstring.
(org-babel-read-element): Fix indentation for example blocks.
2016-02-11 00:00:18 +01:00
Nicolas Goaziou 49bb05487c ob: Remove variables related to inline Babel code
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp):
(org-babel-inline-lob-one-liner-regexp):
(org-babel-lob-one-line-regexp):
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Remove variables.

(org-babel-map-inline-src-blocks):
(org-babel-map-call-lines):
(org-babel-map-executables):
(org-babel-execute-buffer):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Do not use removed variables.

Babel now mostly uses the parser to handle Babel code.  Regexps are not
needed anymore.
2016-02-10 23:50:46 +01:00
Nicolas Goaziou a1ca1f3bee ob: Remove `org-babel-inline-lob-one-line-matches'
* lisp/ob-core.el (org-babel-inline-lob-one-liner-matches): Remove now
  unused function.
2016-02-10 23:50:46 +01:00
Nicolas Goaziou 867263c207 ob: Remove `org-babel-get-inline-src-block-matches'
* lisp/ob-core.el (org-babel-get-inline-src-block-matches): Remove
  function.
(org-babel-when-in-src-block):
(org-babel-insert-result): Do not use removed function.

(org-babel-remove-inline-result): Add an optional argument for a tiny
speed-up.

* testing/examples/babel.org:
* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
  Remove needless tests.
2016-02-10 23:50:45 +01:00
Nicolas Goaziou 9738da4732 ob: Rewrite `org-babel-get-src-block-info' using parser
* lisp/ob-core.el (org-babel-get-src-block-info): Rewrite function.
  Change signature.
(org-babel-parse-src-block-match):
(org-babel-parse-inline-src-block-match): Remove functions.
(org-babel-execute-src-block): Remove useless function call.

* lisp/ob-exp.el (org-babel-exp-process-buffer): Make use of signature
  change.
(org-babel-exp-results): Use new return value from
`org-babel-get-src-block-info'.  Tiny refactoring.

* testing/lisp/test-ob.el (test-ob/nested-code-block): Fix test.
* contrib/lisp/org-eldoc.el (org-eldoc-get-src-lang): Use parser instead
  of removed function.

* testing/examples/babel.org: Fix test environment.
2016-02-10 23:50:45 +01:00
Nicolas Goaziou bd30a58102 ob-exp: Tiny fix
* lisp/ob-exp.el (org-babel-exp-do-export): Fix wrong use for `case'.
2016-02-10 23:50:45 +01:00
Nicolas Goaziou 33aeec4a61 Remove `org-babel-in-example-or-verbatim'
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Remove function.

* testing/lisp/test-ob.el (test-ob/combining-scalar-and-raw-result-types):
Update test.

This function is unused and inaccurate.  If needed, the parser should be
used instead.
2016-02-10 23:50:45 +01:00
Nicolas Goaziou e079c02016 Fix `org-babel-where-is-src-block-result'
* lisp/ob-core.el (org-babel--insert-results-keyword):
(org-babel--clear-results-maybe): New functions.
(org-babel-where-is-src-block-result): Rewrite function.  Improve
accuracy, in particular when RESULTS is not the closest affiliated
keyword from the results.

* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): New test.
2016-02-10 23:50:19 +01:00
Nicolas Goaziou 3d28569130 ob-core: Distinguish between NAME and RESULTS keyword
* lisp/ob-core.el (org-babel-name-regexp): New variable.
(org-babel-result-regexp): Only match RESULTS lines.  Lessen matching
groups.
(org-babel-result-w-name-regexp): Fix regexp.  Add a docstring.
(org-babel-named-data-regexp-for-name): Use new variable.
(org-babel-current-result-hash):
(org-babel-set-current-result-hash):
(org-babel-hide-hash):
(org-babel-result-names):
(org-babel-where-is-src-block-result): Apply changes above.
2016-02-10 15:40:11 +01:00
Nicolas Goaziou 7fcc1c710b ob-core: Prevent false positive in `org-find-named-result'
* lisp/ob-core.el (org-babel-find-named-result): Prevent false positive
  using parser.
(org-babel-current-result-hash):
(org-babel-set-current-result-hash):
(org-babel-where-is-src-block-result): Do not rely on some undocumented
match data.

* testing/lisp/test-ob.el (test-ob/find-name-result): New test.
2016-02-10 15:40:11 +01:00
Nicolas Goaziou 8865920879 ob: Remove indentation information from Babel properties
* lisp/ob-core.el (org-babel-get-src-block-info): Do not return block
  indentation.
(org-babel-parse-src-block-match): Ignore block indentation.
(org-babel-demarcate-block): Find appropriate indentation instead of
using the one from the original block.
(org-babel-where-is-src-block-result): Change signature.  Indent
according to context instead of relying on indentation from original
block.
(org-babel-insert-result): Change signature.
(org-babel-check-confirm-evaluate):
(org-babel-execute-src-block):
(org-babel-insert-header-arg): Apply change to src-block info.

* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply change to
  src-block info.

* lisp/ob-lob.el (org-babel-lob-get-info): Do not return indentation.
(org-babel-lob-execute): Apply change to lob-info.

Indentation from source block is often wrong at the block and its
results may not be in the same context.
2016-02-10 15:40:10 +01:00
Nicolas Goaziou 5f94f49db0 ob: Optimize `org-babel-lob-get-info'
* lisp/ob-core.el (org-babel-goto-named-src-block): Use parser instead
  of `org-babel-lob-one-liner-regexp'.
* lisp/ob-lob.el (org-babel-lob-execute-maybe): Ignore spurious check,
  now handled by the parser.
(org-babel-lob-get-info): Fully use parser.  Accept a new optional
argument to avoid parsing the same location twice.

* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-ref.el (org-babel-ref-resolve): Optimize call to
  `org-babel-lob-get-info'.
2016-02-10 15:40:10 +01:00
Nicolas Goaziou 44e45d5284 Parse inline src blocks and babel calls with newlines
* lisp/org-element.el (org-element--pair-round-table):
(org-element--pair-curly-table): New variables.
(org-element-inline-babel-call-parser):
(org-element-inline-src-block-parser): Allow newline characters in
contents and parameters.

* testing/lisp/test-org-element.el (test-org-element/inline-babel-call-parser):
(test-org-element/inline-src-block-parser): Add test.
2016-02-10 15:40:10 +01:00
Nicolas Goaziou a1d9daa452 org-element: Fix src-block interpreter
* lisp/org-element.el (org-element-src-block-interpreter): Fix function
  according to previous change.
2016-02-10 14:11:48 +01:00
Nicolas Goaziou 111905ff84 org-element: Do not alter indentation upon parsing
* lisp/org-element.el (org-element-src-block-parser):
(org-element-example-block-parser): Do not remove any indentation when
  parsing the element.
* testing/lisp/test-org-element.el (test-org-element/src-block-parser):
* testing/lisp/test-org-element.el (test-org-element/src-block-parser):
  Update test.

Properly handling indentation requires knowing about
`org-src-preserve-indentation''s value.  This is out of the scope of the
parser.
2016-02-09 23:23:31 +01:00
Gary Oberbrunner aa042455a7 ob-sql.el: fix typo preventing mysql table headers from being parsed
* ob-sql.el (org-babel-execute:sql): fix typo (introduced in 8c2e232)
which prevented correct parsing of mysql table headers.
2016-02-09 22:16:53 +01:00
Nicolas Goaziou 16dbf6ded6 Merge branch 'maint' 2016-02-09 21:55:00 +01:00
Nicolas Goaziou 07ee690dce ox-odt: Fix End of file during parsing error
* lisp/ox-odt.el (org-odt-template): Do not call `read' on an empty
  string.

Reported-by: Damien Cassou <damien@cassou.me>
<http://permalink.gmane.org/gmane.emacs.orgmode/104947>
2016-02-09 21:53:20 +01:00
Kyle Meyer 6aff8e3bf2 Merge branch 'maint' 2016-02-08 21:55:22 -05:00
Alan Mackenzie 5d95296029 Backport commit ec90220 from Emacs
Expunge "allow" + infinitive from source and doc, part 2.
ec90220ac1bd81437654d07b769819e1dcd24de5
Alan Mackenzie
Mon Jan 25 12:35:15 2016 +0000
2016-02-08 21:52:09 -05:00
Michael Brand bfa670cd4e Column view: Use `org-hide-leading-stars'
* lisp/org-colview.el (org-columns): Make building of the item stars
dependent on `org-hide-leading-stars'.
2016-02-08 19:59:36 +01:00
Kyle Meyer 4f499fff96 Merge branch 'maint' 2016-02-07 11:56:36 -05:00
Kyle Meyer 30bcff1129 org-capture: Document org-directory
* lisp/org-capture.el (org-capture-templates):
* doc/org.texi (Template elements): Document org-directory.
2016-02-07 11:56:04 -05:00
Michael Brand 96f1bd89e0 `org-file-apps' add migration hint for function signature
* lisp/org.el (org-open-file): Add a user error for when the function
signature does not match.
2016-02-07 12:36:03 +01:00
Nicolas Goaziou 24dacbd833 Merge branch 'maint' 2016-02-07 00:04:27 +01:00
Aaron Ecay 825ce04b9e ob-core: fix bug when source block is at bob
* lisp/ob-core.el (org-babel-get-src-block-info): Fix bug.
2016-02-06 22:01:22 +00:00
Rasmus 18dff8d3fa ox-latex: Fix typo
* lisp/ox-latex.el (org-latex-compiler-file-string): Fix typo.

Reported-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/104836>
2016-02-06 15:52:29 +01:00
Erik Hetzner 5040718945 org-attach.el: Get attachments from git annex
* org-attach.el (org-attach-use-annex): New function to check if git
  annex should be used.
  (org-attach-annex-get-maybe): New function to get a file from git
  annex if necessary.
  (org-attach-annex-auto-get): New defcustom to determine behavior
  of org-attach-annex-get-maybe.
  (org-attach-open): Automatically get attached files from git annex when
  opening if necessary.
* testing/lisp/test-org-annex.el: New file for testing org-attach. Only
  contains code for testing org-attach with git annex at the moment.
* mk/targets.mk: Fix cleantest target so it can delete git annex repos.
2016-02-06 13:17:33 +01:00
Alan Schmitt 06a1fea109 ox-latex.el: Fix minted inline
* lisp/ox-latex.el (org-latex-inline-src-block): Output minted code that
  correctly formats code inline.
2016-02-06 09:48:44 +01:00
Nicolas Goaziou cb05b3a3d7 Fix (void-variable d) error
* lisp/org.el (org-check-before-date):
(org-check-after-date): Ensure D enters the lexical scope.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/104842>
2016-02-06 00:21:59 +01:00
Nicolas Goaziou 3178fcb90d org-colview: Fix length of columns
* lisp/org-colview.el (org-columns-display-here): Do not add star to
  headlines at the display level...
(org-columns): ... but when collecting values, here...
(org-agenda-columns): ... and there.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104846>
2016-02-06 00:04:35 +01:00
Nicolas Goaziou aee808987d Merge branch 'maint' 2016-02-05 23:01:32 +01:00
Nicolas Goaziou cadfbbe8af Remove `org-latex-fragment-image-overlays'
* lisp/org.el (org-latex-fragment-image-overlays): Remove variable.
(org--format-latex-make-overlay): Do not register anymore created
overlays in the removed variable.
(org--list-latex-overlays): New function.
(org-remove-latex-fragment-image-overlays): Use new function.
(org-context): Work around use of `org-latex-fragment-image-overlays'.

Reported-by: Dima Kogan <dima@secretsauce.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/104822>
2016-02-05 22:54:39 +01:00
Nicolas Goaziou 422c5ca3b9 Merge branch 'maint' 2016-02-05 18:39:49 +01:00
Nicolas Goaziou 53b34e6d8c Silence byte-compiler
* lisp/org.el (org--format-latex-make-overlay): Silence byte-compiler.
2016-02-05 18:39:06 +01:00
Nicolas Goaziou 79957188e0 Merge branch 'maint' 2016-02-05 18:36:39 +01:00
Marco Wahl 8a293ac999 org-colview: Fix column view in agenda
* org-colview(org-columns-display-here): Fix for lines without level by
  giving them artificially level 0.

Idea: Exclude lines without level from column-view.
2016-02-05 12:02:52 +01:00
Nicolas Goaziou 6418173b97 Remove LaTeX overlay when text below is modified
* lisp/org.el (org--format-latex-make-overlay): New function.
(org-format-latex): Use new function.

Reported-by: Dima Kogan <dima@secretsauce.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/104800>
2016-02-05 00:08:02 +01:00
Nicolas Goaziou 99697abdb9 org-colview: Add :indent parameter
* lisp/org-colview.el (org-dblock-write:columnview): Handle :indent
  parameter.
* doc/org.texi (Capturing column view): Document new feature.
2016-02-04 23:06:03 +01:00
Nicolas Goaziou 00f0c70418 Special property "ITEM" contains headline without stars
* lisp/org.el (org-entry-properties): "ITEM" contains headline without
  stars.
* lisp/org-colview.el (org-columns-display-here): Apply changes.
* doc/org.texi (Special properties): Update documentation.
* testing/lisp/test-org.el (test-org/entry-properties): Update tests.
2016-02-04 23:06:03 +01:00
Michael Brand 169dfebbff `org-file-apps' add migration hint
* lisp/org.el (org-file-apps): Add an error when still a sexp is in
use.
2016-02-04 18:41:30 +01:00
Kyle Meyer c53936dcfb org-agenda: Fix org-agenda-filter-by-tag-refine
* lisp/org-agenda.el (org-agenda-filter-by-tag-refine): Remove command
  because this functionality is redundant with org-agenda-filter-by-tag
  as of 6c6ae99.

Reported-by: Viktor Rosenfeld <v.rosenfeld@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/104605>
2016-02-03 23:49:48 -05:00
Kyle Meyer e44524b3b2 Merge branch 'maint' 2016-02-03 23:37:26 -05:00
Kyle Meyer b347277ba0 org-agenda: Fix org-agenda-filter-by-tag-refine
* lisp/org-agenda.el (org-agenda-filter-by-tag-refine): Refine rather
  than exlude tags, reverting change from 6c6ae99.  Mark as obsolete
  because this functionality is now redundant with
  org-agenda-filter-by-tag.

Reported-by: Viktor Rosenfeld <v.rosenfeld@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/104605>
2016-02-03 23:34:26 -05:00
Kyle Meyer 2fc29a1796 Fix "it's" typos
* lisp/ob-C.el (org-babel-expand-body:cpp):
(org-babel-expand-body:C++):
(org-babel-expand-body:D):
(org-babel-expand-body:C):
(org-babel-C-expand-C++):
(org-babel-C-expand-C):
(org-babel-C-expand-D):
* lisp/ob-exp.el (org-babel-exp-src-block):
* lisp/ob-fortran.el (org-babel-expand-body:fortran):
* testing/org-test.el (org-test-buffer):
Correct "it's" typo in docstring.

* doc/org.texi:
Correct "it's" typos.
2016-02-03 23:33:28 -05:00
Nicolas Goaziou c8a3ab1e4c `org-file-apps' accept functions instead of sexp
* lisp/org.el (org-file-apps-defaults-macosx): Tiny re-ordering.
(org-file-apps-defaults-windowsnt): Default values provide functions
instead of sexp.
(org-file-apps): Use a function instead of a sexp.

See <http://permalink.gmane.org/gmane.emacs.orgmode/104272>.
2016-02-03 18:30:17 +01:00
Fabrice Popineau 6af83e0aa7 ox-html: Fix org-html-table-row wrt lexical binding
* lisp/ox-html.el (org-html-table-row-open-tag):
(org-html-table-row-close-tag): New variables.
(org-html-table-row-tags): Remove variable.

(org-html-table-row): Use new variables.
2016-02-03 00:10:24 +01:00
Nicolas Goaziou cd9856cc76 Fix `org-make-tags-matcher'
* lisp/org.el (org-make-tags-matcher): With no filter, match everything.

Reported-by: Michael Strey <mstrey@strey.biz>
<http://permalink.gmane.org/gmane.emacs.orgmode/104729>
2016-02-02 22:57:56 +01:00
Nicolas Goaziou 67a8b4026f Resurrect `org-switchb'
* lisp/org.el (org-switchb): New function.

This was removed by mistake in commit
8eb0ef0b42.
2016-02-02 22:33:09 +01:00
Nicolas Goaziou 8eb0ef0b42 Clean up ido and iswitchb left-overs
* lisp/org.el (org-completion-use-ido):
(org-completion-use-iswitchb):
(org-completion-fallback-command): Remove variables.
(org-refile):
(org-set-effort):
(org-read-property-value): Apply variables removal.

(org-iread-file-name): Make it an obsolete alias for `read-file-name'.
(org-file-complete-link): Use `read-file-name'.

(org-switchb): Remove unused function.

Completion mechanisms are expected to be handled at a lower level,
e.g. in `read-file-name-function'.
2016-02-02 22:05:22 +01:00
Nicolas Goaziou 7213aa0f76 ob-R: Silence byte-compiler
* lisp/ob-R.el (org-babel-expand-body:R): Silence byte-compiler.
2016-02-02 18:02:08 +01:00
Nicolas Goaziou 7fa240c739 Merge branch 'maint' 2016-02-02 17:51:33 +01:00
Nicolas Goaziou 34f3260370 org-compat: Fix error on newest Emacsen (>= 25)
* lisp/org-compat.el (org-move-to-column): Ensure `remove' is called on
a list.

Reported-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/104703>
2016-02-02 17:49:23 +01:00
Charles Berry 4d02140130 lisp/ob-R.el: Rename graphics-file arg of org-babel-expand-body:R.
* lisp/ob-R.el: (org-babel-expand-body:R) The third arg is now
  `graphics-file' with no `&' prefix, so edebug can instrument it.
2016-02-01 19:48:49 -08:00
Nicolas Goaziou 8003ef0453 Merge branch 'maint' 2016-02-01 00:19:37 +01:00
Nicolas Goaziou 0b97a55170 org-element: Disable cache for orgstruct-mode
* lisp/org-element.el (org-element--cache-active-p):
(org-element-cache-reset): Do not activate cache outside Org buffers,
even if using "orgstruct-mode".

Reported-by: "Mark A. Hershberger" <mah@nichework.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104648>
2016-02-01 00:17:39 +01:00
Nicolas Goaziou fed40ebf96 Merge branch 'maint' 2016-02-01 00:02:08 +01:00
Nicolas Goaziou ffb08b28cd ob-tangle: Fix :comment org behavior
* lisp/ob-tangle.el (org-babel-spec-to-string): Do not try to comment
  empty text.

Reported-by: Titus von der Malsburg <malsburg@posteo.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/104637>
2016-02-01 00:01:25 +01:00
Nicolas Goaziou 094f46c203 Merge branch 'maint' 2016-01-31 23:32:07 +01:00
Nicolas Goaziou 3aa355c037 ox-latex: Fix numbering of source blocks
* lisp/ox-latex.el (org-latex-src-block): Fix numbering reset on source
  blocks when using the listings package.

Reported-by: P-O Gustafsson <kullager@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104650>
2016-01-31 23:30:49 +01:00
Nicolas Goaziou 7148ae780b Merge branch 'maint' 2016-01-31 23:23:13 +01:00
Nicolas Goaziou 48e046047b ox-html: Properly encode links without a description
* lisp/ox-html.el (org-html-link): Encode URI in default description
  when none is provided.

Reported-by: mail@fritzreichwald.de
<http://permalink.gmane.org/gmane.emacs.orgmode/104645>
2016-01-31 23:21:34 +01:00
Nicolas Goaziou a904245d05 Merge branch 'maint' 2016-01-31 20:58:47 +01:00
Nicolas Goaziou 2f727b0f48 ob-core: Silence byte-compiler 2016-01-31 20:57:47 +01:00
Nicolas Goaziou 06e144adef Merge branch 'maint' 2016-01-31 20:47:06 +01:00
Nicolas Goaziou 67efff2fd8 ob-tangle: Fix `org-babel-tangle-jump-to-org'
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Find correct
  location in the Org document.

* testing/lisp/test-ob-tangle.el (ob-tangle/jump-to-org): New test.
2016-01-31 20:38:35 +01:00
Nicolas Goaziou 7d6b8f51ec ob: Fix `org-babel-update-block-body'
* lisp/ob-core.el (org-babel-update-block-body): Correctly handle block
  indentation.
(org-babel-where-is-src-block-head): Accept an optional argument in
order to avoid parsing twice the same element.

* testing/lisp/test-ob.el (org-test-ob/update-block-body): New test.
2016-01-31 20:38:35 +01:00
Nicolas Goaziou 81c0ea92f8 org-habit: Fix ++ repeaters handling
* lisp/org-habit.el (org-habit-build-graph): Fix algorithm handling "++"
  repeaters.

Reported-by: Yasushi SHOJI <yashi@atmark-techno.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104582>
2016-01-31 00:06:29 +01:00
Michael Brand b4105b430c org-table: Fix ranges in `orgtbl-ascii-draw'
* lisp/org-table.el (orgtbl-ascii-draw): Fix float to integer
  conversion.
* testing/lisp/test-org-table.el (test-org-table/orgtbl-ascii-draw):
  Adapt test.
2016-01-30 16:30:52 +01:00
Kyle Meyer 23ca3fa100 Merge branch 'maint' 2016-01-29 00:28:48 -05:00
Kyle Meyer eb3b1046c6 org-src: Use font-lock-ensure to highlight blocks
* lisp/org-src.el (org-src-font-lock-fontify-block): Use
  org-font-lock-ensure instead of font-lock-fontify-buffer.

This replacement has previously been made (f36b19e, d81e6b5) and then reverted
(99f9999, 003a0f1) twice because source blocks were not being reliably
highlighted when font-lock-ensure was used instead of
font-lock-fontify-buffer.  This was due to a bug in font-lock-ensure
that has now been fixed (see Emacs's 21beb19 and bug#22399).

font-lock-ensure was introduced after Emacs 24.5, so this issue only
pertains to users with a developmental version of Emacs.
2016-01-29 00:28:42 -05:00
Kyle Meyer a4edee4069 org-compat: Update font-lock-ensure alias
* lisp/org-compat.el (org-font-lock-ensure): Add new alias that accepts
  the same number of arguments as font-lock-ensure does.  Use an org-
  prefix.
* lisp/org-clock.el (org-clock-get-clocktable):
* lisp/org.el (org-fontify-like-in-org-mode):
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-odt.el (org-odt-do-format-code):
* lisp/ox-org.el (org-org-publish-to-org): Use org-font-lock-ensure.

See Emacs's bug#22399.
2016-01-29 00:28:37 -05:00
Nicolas Goaziou f8c5c4825e Merge branch 'maint' 2016-01-29 00:53:58 +01:00
Nicolas Goaziou 9ab973d0a6 org-macro: Fix expansion in narrowed buffers
* lisp/org-macro.el (org-macro-replace-all): Expand macro even outside
  narrowed part of the buffer.

* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Add test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104562>
2016-01-29 00:52:49 +01:00
Nicolas Goaziou 13427c9029 Improve compilation checks for some back-ends
* contrib/lisp/ox-groff.el (org-groff-compile):
* lisp/ox-man.el (org-man-compile):
* lisp/ox-texinfo.el (org-texinfo-compile): Check more carefully if
  output file was produced.
2016-01-28 10:02:04 +01:00
Nicolas Goaziou c17fccf904 Merge branch 'maint' 2016-01-27 00:33:15 +01:00
Nicolas Goaziou 75ee067410 org-table: Fix table formulas editing
* lisp/org-table.el (org-table-show-reference): Do not move point
  outside the table when editing formulas.  Fix docstring.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104472>
2016-01-27 00:32:33 +01:00
Nicolas Goaziou 4ebb6cea39 ox-latex: Use `cl-subseq' instead of `org-sublist'
* lisp/ox-latex.el (org-latex-compile): Use `cl-subseq' instead of
  `org-sublist'.
2016-01-26 23:05:04 +01:00
Nicolas Goaziou 03cbcf41ed Merge branch 'maint' 2016-01-26 23:03:11 +01:00
Anthony Cowley a37996910e ox-latex: PDF generation timestamp check
* lisp/ox-latex.el (org-latex-compile): Improve timestamp check on HFS+
  filesystem by only considering 1-second clock resolution.

Previously, the call to (current-time) could return a timestamp with
a non-zero microsecond or picosecond fields, while the file attribute
always has zeros for these fields.  The check that the generated file is
newer than the reference timestamp only succeeded when the time to
generate the file crossed a 1-second clock interval.

TINYCHANGE
2016-01-26 23:02:21 +01:00
Nicolas Goaziou 4c2b52bd8b org-element: Do not remove TAB characters from parsed text
* lisp/org-element.el (org-element--parse-objects): Do not remove TAB
  characters from plain text.
(org-element-normalize-contents): Handle TAB characters in indentation.

* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Update test.
2016-01-26 22:53:55 +01:00
Nicolas Goaziou af1bd190e3 org-element: Small speed-up
* lisp/org-element.el (org-element--parse-objects): Add an optional
  argument to avoid walking a secondary string twice.  Make less
  consing.
(org-element--parse-elements): Make less consing.
(org-element-headline-parser):
(org-element-inlinetask-parser):
(org-element-item-parser):
(org-element-parse-secondary-string): Apply changes.
2016-01-26 22:03:25 +01:00
Nicolas Goaziou 188823e372 org-element: Fix `org-element-set-contents'
* lisp/org-element.el (org-element-set-contents): Fix return value when
  element is empty. Also make sure to always return the element.
2016-01-26 22:03:25 +01:00
Kyle Meyer 15d591ee44 Merge branch 'maint' 2016-01-26 01:17:43 -05:00
Kyle Meyer f02d15d677 ob-core: Fix comment typo from Emacs's 1203e8a 2016-01-26 01:13:51 -05:00
Stefan Monnier 12189858e8 Backport commit 1203e8a from Emacs
* lisp/ob-core.el (org-babel-check-confirm-evaluate)
(org-babel-map-src-blocks): Don't emit warnings if added vars are not used.
(*this*): Declare as dyn-bound.
(org-babel-expand-src-block, org-babel-load-in-session)
(org-babel-switch-to-session-with-code, org-babel-get-rownames):
Mark unused args.
(org-babel-combine-header-arg-lists): Remove unused var `args'.

* lisp/org-src.el (org-inhibit-startup):
Declare as dyn-bound.

lisp/org: Fix some compiler warnings
1203e8aecb7f49621af52cc13bc0e4427545dd4f
Stefan Monnier
Mon Jan 25 10:11:31 2016 -0500
2016-01-26 01:13:26 -05:00
Rafael Laboissiere 7b9f2fba66 Fix logic when activating plain links
* lisp/org.el: Activate plain link when point is outside a tag, instead
  of the other way around.

TINYCHANGE
2016-01-25 17:12:01 +01:00
Nicolas Goaziou 61db4483f8 Merge branch 'maint' 2016-01-25 13:58:28 +01:00
Nicolas Goaziou 73c59ca4ff Tiny refactoring
* lisp/org.el (org-activate-plain-links): Tiny refactoring.
2016-01-25 13:58:05 +01:00
Nicolas Goaziou b8a67993f9 Merge branch 'maint' 2016-01-25 13:57:25 +01:00
Nicolas Goaziou 9eface25da Fix (wrong-type-argument listp org-link) error
* lisp/org.el (org-activate-plain-links): `face' property doesn't not
  necessarily is a list.

Reported-by: gongzhitaao <zhitaao.gong@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104444>
2016-01-25 13:54:47 +01:00
Kyle Meyer 01319a41a3 org-feed: Fix 034c176 merge resolution
Restore unrelated change from 528a274 (org-feed: Silence byte-compiler,
2016-01-07).
2016-01-24 18:23:42 -05:00
Kyle Meyer 034c176995 Merge branch 'maint' 2016-01-24 16:41:20 -05:00
Kyle Meyer e92a06aeb1 org-crypt: Fix comment typo from Emacs's fbce475 2016-01-24 16:37:22 -05:00
Alan Mackenzie 347191042a Backport commit fbce475 from Emacs
Expunge "allow" + infinitive without direct object from source and doc.
fbce4757a874cc43806eb41b8637538b101c3c69
Alan Mackenzie
Sun Jan 24 20:30:39 2016 +0000
2016-01-24 16:35:22 -05:00
Nicolas Goaziou 53472b9c44 Merge branch 'maint' 2016-01-24 18:23:58 +01:00
Nicolas Goaziou 8e74ea3d10 Fix plain links fontification in a narrowed buffer
* lisp/org.el (org-activate-plain-links): Fix fontification when buffer
  is narrowed and (point-min) is no longer 1.
2016-01-24 18:22:00 +01:00
Nicolas Goaziou c10ba5f3dc Merge branch 'maint' 2016-01-24 18:09:22 +01:00
Nicolas Goaziou 921da3290a Fix `org-format-latex' with $$...$$ snippets
* lisp/org.el (org-format-latex): Transform $$...$$ into \[...\] before
  processing with mathjax.
2016-01-24 18:08:23 +01:00
Achim Gratz a88e51dc3f Merge branch 'maint' 2016-01-24 12:09:34 +01:00
Achim Gratz 796f13177a lisp/org.el: correct filemode, changed in b3fbd31f17 2016-01-24 12:09:03 +01:00
Achim Gratz 750e0f91a2 Merge branch 'maint' 2016-01-24 11:25:30 +01:00
Rafael Laboissiere 860bcfbf93 Fix fontification of plain links at beginning of buffer
* lisp/org.el (org-activate-plain-links): Ensure that a valid buffer
  position is given as first argument to get-text-property, in
  particular when the plain link is at the very beginning of the buffer.

TINYCHANGE
2016-01-23 00:43:01 +01:00
Nicolas Goaziou 9d39c9a2ba Merge branch 'maint' 2016-01-22 22:59:29 +01:00
Richard Lawrence 3bf19b30f0 ox-icalendar: Fix timezone export bug
* ox-icalendar.el (org-icalendar-export-current-agenda): Correct
  argument order in call to org-icalendar--vcalendar (timezone should be
  third, description fourth).

TINYCHANGE
2016-01-22 22:58:51 +01:00
Nicolas Goaziou 58af2e01be Merge branch 'maint' 2016-01-21 10:42:58 +01:00