Commit Graph

12030 Commits

Author SHA1 Message Date
Aaron Ecay 5b76509830 org-lint: don’t call org-babel-process-params
* lisp/org-lint.el (org-lint-wrong-header-value): Don’t call
`org-babel-process-params'.

This function adds generated values to the header args: it’s never a
user error if these are incorrect.  It also calls babel code to resolve
:var references, which makes linting an undesirably long and potentially
side-effectful operation.
2015-11-07 20:31:35 +00:00
Aaron Ecay f0380f54c1 ob-ref: fix bug
* lisp/ob-ref.el (org-babel-ref-resolve): Fix error when src block
result is nil.
2015-11-07 20:31:35 +00:00
Charles Berry 3f6e71e62e ob-core.el: org-babel-confirm-evaluate bugfix
* lisp/ob-core.el (org-babel-confirm-evaluate): Return t/nil for y/n answer to query.   Minor edits of prompt and message.
2015-11-07 09:39:17 -08:00
Nicolas Goaziou d24a9b7645 Change references from Org 8.4 to 9.0
According to <http://mid.gmane.org/87oai4w69i.fsf@gnu.org>, master is
the root for Org 9.0, not Org 8.4.
2015-11-07 17:11:48 +01:00
Nicolas Goaziou d35d1e0502 ob-core: Fix typo
* lisp/ob-core.el (org-babel-read-element): Remove `paragraph', which is
  matched earlier.
2015-11-06 23:33:45 +01:00
Nicolas Goaziou cdfc96f47c ox-latex: Do not merge consecutive $$...$$
* lisp/ox-latex.el (org-latex-latex-fragment): Since $$..$$ snippets are
  not wrapped within a math-block, do not remove markers.
(org-latex--wrap-latex-math-block): Do not wrap $$...$$ LaTeX snippets.
2015-11-06 23:01:03 +01:00
Nicolas Goaziou 265e5b9984 ox-ascii: Fix footnotes export
* lisp/ox-ascii.el (org-ascii-inner-template): Since 47265b3, footnotes
  definitions' contents do no start with `org-data'.  Update code.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102648>
2015-11-06 20:58:14 +01:00
Aaron Ecay cce317faf6 Fix bug in 95e2777 2015-11-06 19:11:07 +00:00
Aaron Ecay 95e2777663 ox.el: Add :safe declarations to defcustoms
* lisp/ox.el: Add :safe declarations to defcustoms.
2015-11-06 17:49:57 +00:00
Aaron Ecay fa1a9aad8e org.el: Don’t special-case ‘define-obsolete-function-alias’ for emacs <= 23 2015-11-06 12:50:42 +00:00
Aaron Ecay 861b6b1bd0 org.el: Obsolete ‘org-image-file-name-regexp’
* lisp/org.el (org-image-file-name-regexp): Make obsolete.  Change
callers.
2015-11-06 12:50:42 +00:00
Aaron Ecay d29d9a029c org.el: Refactor ‘org-previous-line-empty-p’
* lisp/org.el (org--line-empty-p):
(org-next-line-empty-p): New functions.
(org-previous-line-empty-p): Remove `next' argument.  Call
`org--line-empty-p'.
2015-11-06 12:50:41 +00:00
Aaron Ecay a6768538d6 org.el: mark `org-on-heading-p' obsolete.
* lisp/org.el (org-on-heading-p): Mark obsolete.
2015-11-06 12:50:41 +00:00
Aaron Ecay 8b4672bdd0 org.el: Minor refactorings.
* lisp/org.el (org-force-cycle-archived):
(org-do-emphasis-faces):
(org-entry-end-position):
(org-check-and-save-marker):
(org-cancel-repeater):
(org-update-parent-todo-statistics):
(org-scan-tags):
(org-yank-folding-would-swallow-text): Refactor.
2015-11-06 12:50:41 +00:00
Aaron Ecay e4cd3dd22b Remove some home-grown copies of cl-lib functions.
* lisp/org.el (org-count, org-remove-if, org-remove-if-not):
(org-reduce, org-every, org-some): Obsolete, use cl-lib versions
everywhere.
(org-sublist): Reimplement in terms of `cl-subseq'; make obsolete.
2015-11-06 12:50:40 +00:00
Aaron Ecay 2e26751b4c org.el: use ‘when’ and ‘unless’ instead of single-branch ‘if’
* lisp/org.el: Refactor single-branch `if' to `when' or `unless' as
appropriate.  Also apply other misc. refactorings of conditionals.
2015-11-06 12:47:04 +00:00
Aaron Ecay c7f1b55995 Mark `org-table-recognize-table.el' obsolete
* lisp/org.el (org-at-table-hline-p): Mark obsolete.

No org code has called this function since 2010.
2015-11-06 12:47:04 +00:00
Aaron Ecay 48096562ba Make `org-table-p' obsolete.
* lisp/org.el: Make `org-table-p' obsolete.  Change all callers.
2015-11-06 12:47:04 +00:00
Nicolas Goaziou 89b05fe7f7 ox-texinfo: Use lexical binding
* lisp/ox-texinfo.el (org-texinfo-format-drawer-function):
(org-texinfo--filter-section-blank-lines):
(org-texinfo--text-markup):
(org-texinfo-bold):
(org-texinfo-center-block):
(org-texinfo-clock):
(org-texinfo-code):
(org-texinfo-dynamic-block):
(org-texinfo-entity):
(org-texinfo-example-block):
(org-texinfo-export-block):
(org-texinfo-export-snippet):
(org-texinfo-fixed-width):
(org-texinfo-footnote-reference):
(org-texinfo-format-headline-default-function):
(org-texinfo-inline-src-block):
(org-texinfo-format-inlinetask-default-function):
(org-texinfo-italic):
(org-texinfo-keyword):
(org-texinfo-line-break):
(org-texinfo-node-property):
(org-texinfo-paragraph):
(org-texinfo-planning):
(org-texinfo-property-drawer):
(org-texinfo-quote-block):
(org-texinfo-special-block):
(org-texinfo-src-block):
(org-texinfo-statistics-cookie):
(org-texinfo-subscript):
(org-texinfo-superscript):
(org-texinfo-target):
(org-texinfo-timestamp):
(org-texinfo-verbatim):
(org-texinfo-verse-block): Silence byte-compiler.
2015-11-06 00:11:00 +01:00
Nicolas Goaziou 5ed56ffa4c ox-publish: Use lexical binding
* lisp/ox-publish.el (org-publish-needed-p):
(org-publish-update-timestamp):
(org-publish-remove-all-timestamps):
(org-publish-get-base-files-1):
(org-publish-get-base-files):
(org-publish-get-project-from-filename):
(org-publish-attachment):
(org-publish-org-sitemap):
(org-publish):
(org-publish-all):
(org-publish-current-file):
(org-publish-collect-index):
(org-publish--collect-references):
(org-publish-cache-file-needs-publishing): Silence byte-compiler.
Replace `mapc' + `lambda' with `dolist'.
2015-11-05 23:55:51 +01:00
Nicolas Goaziou 9d3d95b6e5 ox-org: Use lexical binding
* lisp/ox-org.el (org-org-identity):
(org-org-keyword):
(org-org-link): Silence byte-compiler.
2015-11-05 23:40:53 +01:00
Nicolas Goaziou 0edad6725a Merge branch 'maint' 2015-11-05 23:24:10 +01:00
Nicolas Goaziou 73a5c27cc1 Fix table editing with an active region
* lisp/org.el (org-self-insert-command): Do not call
  `backward-delete-char' since it possibly deletes active region.
  Simplify code.

This fixes bug#21838.
2015-11-05 23:18:13 +01:00
Aaron Ecay 07e16c2fc5 Use setq-local and defvar-local.
* lisp/org-macs.el (org-set-local): Remove.  All callers changed.
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-macro.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/org.el: Use defvar-local.
* lisp/org-agenda.el:
* lisp/org-capture.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-plot.el:
* lisp/org.el:
* lisp/ox-odt.el:
* lisp/ox.el: Use setq-local instead of set + make-local-variable.

Changes in contrib:

* contrib/lisp/org-colview-xemacs.el (org-colview-xemacs-set-local): New
macro. Adjust old callers of `org-set-local'.
2015-11-05 16:47:38 +00:00
Aaron Ecay 40356ae376 babel: convert org-babel-check-confirm-evaluate to defun, add test
* lisp/ob-core.el (org-babel-check-confirm-evaluate): Convert from macro
to function.
(org-babel-check-evaluate):
(org-babel-confirm-evaluate): Adapt to above change.  Convert from
defsubst to defun.
* testing/lisp/test-ob.el (ob/check-eval) New test.
(org-test-babel-confirm-evaluate): New function supporting it.
2015-11-05 15:54:19 +00:00
Aaron Ecay 4750e4427d babel: small fix.
* lisp/ob-core.el (org-babel-execute-src-block): Simplify code slightly.

The old code would error on evaluating the call line in:

,----
| #+name: foo
| #+begin_src emacs-lisp :var bar="baz"
|   bar
| #+end_src
|
| #+call: foo[:cache yes]("qux")
|
| #+RESULTS:
| : qux
`----
2015-11-05 15:03:58 +00:00
Nicolas Goaziou 02c7850147 ob: Ignore data in COMMENTed headings
* lisp/ob-core.el (org-babel-read-element): New function.
* lisp/ob-ref.el (org-babel-ref-resolve): Use new function.  Refactor
  code.
(org-babel-ref-at-ref-p): Remove function.

* testing/lisp/test-ob.el (test-ob/ignore-reference-in-commented-headings):
  New test.
* testing/lisp/test-ob.el (test-ob/resolve-code-blocks-before-data-blocks):
  Remove test

The second test is removed because names are expected to be unique.
There is no order to expect when more than one uses the same name.

Reported-by: myq <myqlarson@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102464>
2015-11-05 15:44:22 +01:00
Nicolas Goaziou 5e22dcd622 Fix bug#21818
* lisp/org.el (org-insert-link): Redisplay after inserting link.

Reported-by: Emanuel Evans <mail@emanuel.industries>
<http://permalink.gmane.org/gmane.emacs.orgmode/102591>
2015-11-05 13:45:12 +01:00
Nicolas Goaziou d5767ad31f Fix bug#21818
* lisp/org.el (org-insert-link): Redisplay after inserting link.

Reported-by: Emanuel Evans <mail@emanuel.industries>
<http://permalink.gmane.org/gmane.emacs.orgmode/102591>
2015-11-05 12:26:01 +01:00
Nicolas Goaziou 3b8ebff351 ox: Fix failing tests
* lisp/ox.el (org-export-as): Add missing arguments to
  `org-export--get-export-attributes'.
2015-11-05 12:07:48 +01:00
Nicolas Goaziou 47573133a6 ox: Small refactoring
* lisp/ox.el (org-export--get-min-level):
(org-export-install-filters):
(org-export--generate-copy-script):
(org-export-table-has-special-column-p):
(org-export-table-row-is-special-p):
(org-export-table-cell-borders):
(org-export--dispatch-action): Use dolist instead of `mapc' + `lambda'.
2015-11-05 11:05:29 +01:00
Nicolas Goaziou 8048973bae ox: Rename `org-export-collect-tree-properties'
* lisp/ox.el (org-export-collect-tree-properties): Remove function.
(org-export--collect-tree-properties): New function.
  Renamed from `org-export-collect-tree-properties'
(org-export-as): Apply renaming.
* testing/lisp/test-ox.el (org-test-with-parsed-data): Apply renaming.
2015-11-05 10:56:59 +01:00
Nicolas Goaziou b414b85a7c ox: Factorize export properties
* lisp/ox.el (org-export-get-environment): Do not handle :back-end
  and :translate-alist.
(org-export--collect-tree-properties): Do not handle :exported-data.
(org-export--get-export-attributes): New function.
(org-export-as): Use new function.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Use new function.
2015-11-05 10:56:42 +01:00
Nicolas Goaziou f329279757 ox: Check id links in export scope only
* lisp/ox.el (org-export-get-environment): Do not fill :id-alist yet.
(org-export-collect-tree-properties): Complete it here instead.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102540>
2015-11-05 09:20:05 +01:00
Nicolas Goaziou 0611129578 Small fixes
* lisp/ob-asymptote.el (org-babel-asymptote-define-type):
* lisp/ob-processing.el (org-babel-processing-define-type): Small fixes
  following lexical binding move.
2015-11-03 12:34:47 +01:00
Nicolas Goaziou 9b5757cb47 org-list: Fix small bug
* lisp/org-list.el (org-list-to-generic): Fix lexical binding mistake.
2015-11-02 22:09:05 +01:00
Nicolas Goaziou a274c21419 ox-latex: Fix "void function nil" error
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions): Fix "void
  function nil" error.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102477>
2015-11-02 20:58:50 +01:00
Nicolas Goaziou 4ca1179c9e ox-odt: Use lexical binding
* lisp/ox-odt.el (org-odt-styles-dir):
(org-odt-schema-dir):
(org-odt-format-drawer-function):
(org-odt--zip-extract):
(org-odt-format-toc-headline):
(org-odt--build-date-styles):
(org-odt-template):
(org-odt-bold):
(org-odt-center-block):
(org-odt-code):
(org-odt-dynamic-block):
(org-odt-entity):
(org-odt-example-block):
(org-odt-export-snippet):
(org-odt-export-block):
(org-odt-fixed-width):
(org-odt-footnote-reference):
(org-odt-format-headline--wrap):
(org-odt-headline):
(org-odt-horizontal-rule):
(org-odt-inline-src-block):
(org-odt-italic):
(org-odt-item):
(org-odt-keyword):
(org-odt-latex-environment):
(org-odt-latex-fragment):
(org-odt-line-break):
(org-odt--enumerate):
(org-odt-link--inline-image):
(org-odt-link--inline-formula):
(org-odt--enumerable-p):
(org-odt--standalone-link-p):
(org-odt-link):
(org-odt-node-property):
(org-odt-plain-list):
(org-odt--encode-plain-text):
(org-odt-plain-text):
(org-odt-property-drawer):
(org-odt-quote-block):
(org-odt-section):
(org-odt-htmlfontify-string):
(org-odt-src-block):
(org-odt-statistics-cookie):
(org-odt-strike-through):
(org-odt-subscript):
(org-odt-superscript):
(org-odt-table-cell):
(org-odt--table):
(org-odt-target):
(org-odt-timestamp):
(org-odt-underline):
(org-odt-verbatim):
(org-odt-verse-block):
(org-odt--translate-latex-fragments):
(org-odt--translate-description-lists):
(org-odt--translate-list-tables):
(org-odt-write-manifest-file):
(org-odt--export-wrap):
(org-odt-do-convert):
(org-odt-reachable-formats):
(org-odt-convert): Silence byte-compiler.  Replace `mapc' + `lambda'
with `dolist'.
2015-11-01 00:58:57 +01:00
Nicolas Goaziou ed76447f59 ox-md: Use lexical binding
* lisp/ox-md.el (org-md-separate-elements):
(org-md-bold):
(org-md-verbatim):
(org-md-example-block):
(org-md-horizontal-rule):
(org-md-italic):
(org-md-line-break):
(org-md-node-property):
(org-md-paragraph):
(org-md-plain-list):
(org-md-property-drawer):
(org-md-quote-block):
(org-md-section):
(org-md-template): Silence byte-compiler.
2015-11-01 00:05:22 +01:00
Nicolas Goaziou 3f6746d8a9 ox-man: Use lexical binding
* lisp/ox-man.el (org-man-custom-lang-environments): Remove variable.
(org-man-clock): Remove function.

(org-man-bold):
(org-man-center-block):
(org-man-drawer):
(org-man-dynamic-block):
(org-man-entity):
(org-man-example-block):
(org-man-export-block):
(org-man-export-snippet):
(org-man-fixed-width):
(org-man-headline):
(org-man-inline-src-block):
(org-man-italic):
(org-man-keyword):
(org-man-line-break):
(org-man-link):
(org-man-node-property):
(org-man-paragraph):
(org-man-plain-list):
(org-man-property-drawer):
(org-man-quote-block):
(org-man-radio-target):
(org-man-section):
(org-man-special-block):
(org-man-src-block):
(org-man-statistics-cookie):
(org-man-strike-through):
(org-man-subscript):
(org-man-superscript):
(org-man-table-row):
(org-man-target):
(org-man-timestamp):
(org-man-underline):
(org-man-verbatim):
(org-man-verse-block): Silence byte-compiler.
2015-11-01 00:00:40 +01:00
Nicolas Goaziou a87c34cb8d 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>
2015-10-31 23:32:47 +01:00
Nicolas Goaziou 11a451ff98 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.
2015-10-31 23:19:51 +01:00
Nicolas Goaziou 7f20175807 org-agenda: Small refactoring
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled):
2015-10-31 22:28:04 +01:00
Nicolas Goaziou e6ac458988 org-agenda: Fix diary sexp timestamps
* lisp/org-agenda.el (org-agenda--timestamp-to-absolute): New function.
(org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled): Use new function.

* lisp/org.el (org-diary-sexp-no-match): New error.
(org-time-string-to-absolute): Raise an error when a diary sexp cannot
match instead of returning a nonsensical value.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102417>
2015-10-31 22:26:13 +01:00
Nicolas Goaziou 6e6b19bc96 org-compat: Implement `org-define-error'
* lisp/org-compat.el (org-define-error): New function.
* lisp/ox.el (org-link-broken): Use new function.
2015-10-31 22:26:13 +01:00
Kyle Meyer 59468ab2d8 Merge branch 'maint' 2015-10-31 12:49:59 -04:00
Kyle Meyer 59d706219b org-format-outline-path: Ignore nil path elements
* lisp/org.el (org-format-outline-path): Ignore nil path elements.
* testing/lisp/test-org.el (test-org/format-outline-path): Add test.

The PATH argument shouldn't contain a nil item.  However, this didn't
fail before 1c74002, and helm-get-org-candidates-in-file relies on this
behavior, so prevent it from failing now.

Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102411>
2015-10-31 12:47:17 -04:00
Kyle Meyer 1ec47568f4 org-format-outline-path: Cosmetic fix
* lisp/org.el (org-format-outline-path): Change loop counter.

The old version gives the same result when combined with the other for
clause, but it reads as though the intention is to reach
(length path) rather than (1- (length path)).
2015-10-31 12:35:13 -04:00
Aaron Ecay 0b78c71cd5 fix 0d000f5
* lisp/ob-core.el (org-babel-process-params): Fix bug introduced by
commit 0d000f5.
2015-10-30 11:35:45 +00:00
Aaron Ecay 0d000f5680 babel: small change in API.
* lisp/ob-core.el (org-babel--get-vars): New function.
(org-babel-get-header): Delete.
* lisp/ob-C.el (org-babel-C-expand-C):
(org-babel-C-expand-D):
* lisp/ob-R.el (org-babel-variable-assignments:R):
* lisp/ob-abc.el (org-babel-expand-body:abc):
* lisp/ob-asymptote.el (org-babel-variable-assignments:asymptote):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-dot.el (org-babel-expand-body:dot):
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp):
* lisp/ob-fortran.el (org-babel-expand-body:fortran):
(org-babel-fortran-ensure-main-wrap):
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars):
* lisp/ob-haskell.el (org-babel-variable-assignments:haskell):
* lisp/ob-js.el (org-babel-variable-assignments:js):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lilypond.el (org-babel-expand-body:lilypond):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-maxima.el (org-babel-maxima-expand):
* lisp/ob-ocaml.el (org-babel-variable-assignments:ocaml):
* lisp/ob-octave.el (org-babel-variable-assignments:octave):
* lisp/ob-org.el (org-babel-expand-body:org):
* lisp/ob-perl.el (org-babel-variable-assignments:perl):
* lisp/ob-picolisp.el (org-babel-expand-body:picolisp):
* lisp/ob-processing.el (org-babel-variable-assignments:processing):
* lisp/ob-python.el (org-babel-variable-assignments:python):
* lisp/ob-ruby.el (org-babel-variable-assignments:ruby):
* lisp/ob-scheme.el (org-babel-expand-body:scheme):
* lisp/ob-shell.el (org-babel-variable-assignments:shell):
* lisp/ob-shen.el (org-babel-expand-body:shen):
* lisp/ob-sql.el (org-babel-expand-body:sql):
* lisp/ob-sqlite.el (org-babel-expand-body:sqlite): Adapt to change.
* etc/ORG-NEWS: Document change.
2015-10-29 19:26:11 +00:00
Aaron Ecay a42b4609c2 Merge branch 'maint' into remove-get-header 2015-10-29 19:21:24 +00:00
Aaron Ecay 54d3032cdc babel: fix header arg duplication
* lisp/ob-core.el (org-babel-process-params): Make idempotent.
* testing/lisp/test-ob.el (ob/process-params-no-duplicates): New test.
2015-10-29 19:10:08 +00:00
Nicolas Goaziou 8bccb21313 ox-latex: Use lexical binding
* lisp/ox-latex.el (org-latex-format-drawer-function):
(org-latex-bold):
(org-latex-clock):
(org-latex-code):
(org-latex-entity):
(org-latex-example-block):
(org-latex-export-block):
(org-latex-export-snippet):
(org-latex-fixed-width):
(org-latex-footnote-reference):
(org-latex-format-headline-default-function):
(org-latex-horizontal-rule):
(org-latex-inline-src-block):
(org-latex-format-inlinetask-default-function):
(org-latex-italic):
(org-latex-keyword):
(org-latex-latex-environment):
(org-latex-latex-fragment):
(org-latex-line-break):
(org-latex-node-property):
(org-latex-paragraph):
(org-latex-planning):
(org-latex-property-drawer):
(org-latex-matrices):
(org-latex-matrices-tree-filter):
(org-latex-math-block-tree-filter):
(org-latex-math-block-options-filter):
(org-latex-math-block):
(org-latex-section):
(org-latex-src-block):
(org-latex-statistics-cookie):
(org-latex-strike-through):
(org-latex--script-size):
(org-latex-subscript):
(org-latex-superscript):
(org-latex-target):
(org-latex-timestamp):
(org-latex-underline):
(org-latex-verbatim):
(org-latex-compile): Silence byte-compiler.  Refactor `mapc' + `lambda'
into `dolist'.
2015-10-29 19:08:26 +01:00
Nicolas Goaziou 6ea83b5660 ox-beamer: Silence byte-compiler
* lisp/ox-beamer.el (org-beamer-export-block): Silence byte-compiler.
2015-10-29 18:54:31 +01:00
Nicolas Goaziou ef9c2a8b4b ox-icalendar: Use lexical binding
* lisp/ox-icalendar.el (org-icalendar-get-categories):
(org-icalendar-clear-blank-lines):
(org-icalendar-export-agenda-files):
(org-icalendar-combine-agenda-files): Silence byte-compiler.  Refactor
`mapc' + `lambda' into `dolist'.
2015-10-29 18:53:03 +01:00
Nicolas Goaziou d51e27e4fe ox-beamer: Use lexical binding
* lisp/ox-beamer.el (org-beamer-bold):
(org-beamer-export-block):
(org-beamer-export-snippet):
(org-beamer-item):
(org-beamer-link):
(org-beamer-target): Silence byte-compiler.
2015-10-29 18:39:29 +01:00
Nicolas Goaziou 0198e3955d ox-html: Use lexical binding
* lisp/ox-html.el (org-html-infojs-install-script):
(org-html-format-drawer-function):
(org-html--has-caption-p):
(org-html--make-string):
(org-html-footnote-section):
(org-html--build-mathjax-config):
(org-html--build-pre/postamble):
(org-html--priority):
(org-html--toc-text):
(org-html-bold):
(org-html-center-block):
(org-html-clock):
(org-html-code):
(org-html-dynamic-block):
(org-html-entity):
(org-html-example-block):
(org-html-export-snippet):
(org-html-export-block):
(org-html-fixed-width):
(org-html-footnote-reference):
(org-html-headline):
(org-html-format-headline-default-function):
(org-html-horizontal-rule):
(org-html-inline-src-block):
(org-html-italic):
(org-html-keyword):
(org-html-latex-environment):
(org-html-latex-fragment):
(org-html-line-break):
(org-html-node-property):
(org-html-plain-list):
(org-html-convert-special-strings):
(org-html-planning):
(org-html-property-drawer):
(org-html-quote-block):
(org-html-src-block):
(org-html-statistics-cookie):
(org-html-strike-through):
(org-html-subscript):
(org-html-superscript):
(org-html-table-row):
(org-html-table--table.el-table):
(org-html-target):
(org-html-timestamp):
(org-html-underline):
(org-html-verbatim):
(org-html-verse-block):
(org-html-final-function): Silence byte-compiler.  Refactor `mapc' +
`lambda' into `dolist'.
2015-10-29 18:35:20 +01:00
Nicolas Goaziou 72c3f5e8e5 org-agenda: Fix `org-agenda-get-scheduled'
* lisp/org-agenda.el (org-agenda-get-scheduled): Rewrite function.
  Comment code.  Fix fontification and sorting issues introduced in
  9e18583.
2015-10-28 14:48:48 +01:00
Nicolas Goaziou 10a3d601ec org-agenda: Fix small bug
* lisp/org-agenda.el (org-agenda-get-day-entries): Rewrite function to
  avoid O(n^2) complexity.  Also fix empty deadline list passed as
  argument when :deadline (or :deadline*) is not the first symbol.
2015-10-28 14:48:48 +01:00
Nicolas Goaziou c29eee4836 org-agenda: Rename `org-agenda-todayp' as `org-agenda-today-p'
* lisp/org-agenda.el (org-agenda-today-p): New function.
(org-agenda-todayp): Deprecate function.
(org-agenda-get-day-face):
(org-agenda-get-deadlines):
(org-agenda-todo): Apply renaming.
2015-10-28 14:48:43 +01:00
Nicolas Goaziou f774552a00 org-agenda: Clarify docstring
* lisp/org-agenda.el (org-scheduled-past-days): Clarify docstring.
2015-10-28 12:19:56 +01:00
Kyle Meyer b9676a2575 Merge branch 'maint' 2015-10-28 01:47:43 -04:00
Kyle Meyer 1c740023f7 Rewrite org-format-outline-path
* lisp/org.el (org-format-outline-path): Avoid out-of-range error when
  the length of PREFIX is greater than the value given for WIDTH.
  Prevent result from extending beyond WIDTH.  Simplify code.
* testing/lisp/test-org.el (test-org/format-outline-path): Add tests.

Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102241>
2015-10-28 01:26:16 -04:00
Marco Wahl ab763a8d7b Merge branch 'master' of orgmode.org:org-mode 2015-10-26 21:42:38 +01:00
Marco Wahl ca8a0234fc ox-latex: Fix typo in docstring 2015-10-26 21:38:04 +01:00
Nicolas Goaziou 9e18583242 Fix 3072cb2
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): When closest scheduled/deadline date is
today, also report all days since original timestamp.
2015-10-26 21:29:12 +01:00
Nicolas Goaziou 7706714200 Switch some Babel-related libraries to lexical binding
* lisp/ob-sed.el:
* lisp/ob-shen.el:
(org-babel-execute:shen):
* lisp/ob-sql.el:
(org-babel-prep-session:sql):
* lisp/ob-sqlite.el:
(org-babel-execute:sqlite):
(org-babel-prep-session:sqlite):
* lisp/ob-stan.el:
(org-babel-prep-session:stan):
* lisp/ob-table.el: Switch some libraries to lexical binding.
2015-10-26 16:58:34 +01:00
Rasmus 385f2381f9 ox-latex: Add mapping for R src blocks with minted
* ox-latex.el (org-latex-listings-langs): Add mapping for R.
2015-10-26 15:39:52 +01:00
Nicolas Goaziou e868ef0886 Silence byte-compiler 2015-10-26 09:29:13 +01:00
Nicolas Goaziou f0bf77e82a Activate lexical binding in some libraries
* lisp/ob-C.el (org-babel-prep-session:C):
(org-babel-load-session:C):
* lisp/ob-J.el:
(org-babel-expand-body:J):
(org-babel-execute:J):
* lisp/ob-R.el:
(org-babel-expand-body:R):
* lisp/ob-abc.el:
(org-babel-execute:abc):
(org-babel-prep-session:abc):
* lisp/ob-asymptote.el:
(org-babel-execute:asymptote):
(org-babel-prep-session:asymptote):
* lisp/ob-awk.el:
(org-babel-expand-body:awk):
* lisp/ob-calc.el:
(org-babel-expand-body:calc):
* lisp/ob-clojure.el:
* lisp/ob-comint.el:
(org-babel-comint-in-buffer):
(org-babel-comint-with-output):
(org-babel-comint-eval-invisibly-and-wait-for-file):
* lisp/ob-coq.el:
* lisp/ob-css.el:
(org-babel-execute:css):
(org-babel-prep-session:css):
* lisp/ob-ditaa.el:
(org-babel-execute:ditaa):
(org-babel-prep-session:ditaa):
* lisp/ob-dot.el:
(org-babel-execute:dot):
(org-babel-prep-session:dot):
* lisp/ob-ebnf.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-eval.el:
* lisp/ob-forth.el:
* lisp/ob-fortran.el:
(org-babel-execute:fortran):
(org-babel-prep-session:fortran):
(org-babel-load-session:fortran):
* lisp/ob-gnuplot.el:
(org-babel-expand-body:gnuplot):
(org-babel-prep-session:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-groovy.el:
(org-babel-prep-session:groovy):
(org-babel-groovy-initiate-session):
* lisp/ob-haskell.el:
(org-babel-haskell-initiate-session):
* lisp/ob-io.el:
(org-babel-prep-session:io):
(org-babel-io-initiate-session):
* lisp/ob-java.el:
(org-babel-execute:java):
* lisp/ob-js.el:
* lisp/ob-keys.el:
* lisp/ob-latex.el:
(org-babel-prep-session:latex):
* lisp/ob-ledger.el:
(org-babel-execute:ledger):
(org-babel-prep-session:ledger):
* lisp/ob-lilypond.el:
(org-babel-lilypond-commands):
(org-babel-lilypond-process-basic):
(org-babel-prep-session:lilypond):
(org-babel-lilypond-parse-line-num):
* lisp/ob-lisp.el:
* lisp/ob-makefile.el:
(org-babel-execute:makefile):
(org-babel-prep-session:makefile):
* lisp/ob-matlab.el:
* lisp/ob-maxima.el:
(org-babel-prep-session:maxima):
* lisp/ob-mscgen.el:
(org-babel-prep-session:mscgen):
* lisp/ob-ocaml.el:
(org-babel-execute:ocaml):
(org-babel-prep-session:ocaml):
* lisp/ob-octave.el:
(org-babel-execute:octave):
(org-babel-octave-initiate-session):
* lisp/ob-org.el:
(org-babel-prep-session:org):
* lisp/ob-perl.el:
(org-babel-prep-session:perl):
(org-babel-perl--var-to-perl):
(org-babel-perl-initiate-session):
* lisp/ob-picolisp.el:
(org-babel-expand-body:picolisp):
(org-babel-execute:picolisp):
* lisp/ob-plantuml.el:
(org-babel-execute:plantuml):
(org-babel-prep-session:plantuml):
* lisp/ob-processing.el:
(org-babel-prep-session:processing):
* lisp/ob-python.el:
(org-babel-python-initiate-session):
* lisp/ob-ref.el:
(org-babel-ref-resolve):
* lisp/ob-ruby.el:
(org-babel-ruby-initiate-session):
* lisp/ob-sass.el:
(org-babel-execute:sass):
(org-babel-prep-session:sass):
* lisp/ob-scala.el:
(org-babel-execute:scala):
(org-babel-prep-session:scala):
(org-babel-scala-initiate-session):
* lisp/ob-scheme.el:
* lisp/ob-screen.el:
(org-babel-prep-session:screen):
(org-babel-screen-session-write-temp-file):
(org-babel-screen-test):
* lisp/ob.el:
* lisp/org-colview.el:
(org-columns-todo):
(org-columns-set-tags-or-toggle):
(org-columns-new):
(org-columns-uncompile-format):
(org-agenda-colview-summarize):
* lisp/org-footnote.el:
(electric-indent-mode):
* lisp/org-indent.el:
(org-indent-refresh-maybe):
* lisp/org-list.el:
* lisp/org-macro.el:
(org-macro--collect-macros):
* lisp/org-src.el:
* lisp/org-table.el:
(sort-fold-case):
(org-table-create):
(org-table-field-info):
(org-table-transpose-table-at-point):
(org-table-remove-rectangle-highlight):
(orgtbl-create-or-convert-from-region):
(org-define-lookup-function):
* lisp/ox-ascii.el:
(org-ascii-format-drawer-function):
(org-ascii--has-caption-p):
(org-ascii-bold):
(org-ascii-center-block):
(org-ascii-clock):
(org-ascii-code):
(org-ascii-dynamic-block):
(org-ascii-entity):
(org-ascii-example-block):
(org-ascii-export-snippet):
(org-ascii-export-block):
(org-ascii-fixed-width):
(org-ascii-footnote-reference):
(org-ascii-horizontal-rule):
(org-ascii-inline-src-block):
(org-ascii-format-inlinetask-default):
(org-ascii-italic):
(org-ascii-keyword):
(org-ascii-latex-environment):
(org-ascii-latex-fragment):
(org-ascii-line-break):
(org-ascii-node-property):
(org-ascii-planning):
(org-ascii-quote-block):
(org-ascii-radio-target):
(org-ascii-special-block):
(org-ascii-src-block):
(org-ascii-statistics-cookie):
(org-ascii-subscript):
(org-ascii-superscript):
(org-ascii-strike-through):
(org-ascii-timestamp):
(org-ascii-underline):
(org-ascii-verbatim):
(org-ascii-verse-block):
(org-ascii-filter-headline-blank-lines):
(org-ascii-filter-paragraph-spacing):
(org-ascii-filter-comment-spacing): Use lexical binding.
2015-10-26 01:56:00 +01:00
Nicolas Goaziou b4af3f0852 Allow more characters in emphasis
* lisp/org.el (org-emphasis-regexp-components): Allow singe quote,
  double quote and comma as the last character in an emphasis string.

Reported-by: Marcin Borkowski <mbork@mbork.pl>
<http://permalink.gmane.org/gmane.emacs.orgmode/102191>
2015-10-25 19:20:25 +01:00
Nicolas Goaziou 3072cb28e8 org-agenda: Improve display for repeaters
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): For past repeaters, compute the number of
scheduled or deadline days since original date, not closest repeater.

Suggested-by: cesar mena <cmena@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101884>
2015-10-25 18:21:03 +01:00
Nicolas Goaziou ebe2d83eea Partly revert "Change `org-agenda-repeating-timestamp-show-all' targets"
* lisp/org.el (org-closest-date): Handle every type of repeater.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102021>
2015-10-25 16:48:50 +01:00
Nicolas Goaziou 842c5f7cb7 Merge branch 'maint' 2015-10-25 15:55:44 +01:00
Nicolas Goaziou 541aa0f62d org-clock: Fix clocking in
* lisp/org-clock.el (org-clock-find-position): Correctly position cursor
  on the correct headline.

Reported-by: Jan Malakhovski <oxij@oxij.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102170>
2015-10-25 15:51:53 +01:00
Nicolas Goaziou ba4d3376c1 org-lint: Allow sorting by warning message.
* lisp/org-lint.el (org-lint--report-mode): Allow sorting by warning message.

Suggested-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102047>
2015-10-24 11:41:44 +02:00
Nicolas Goaziou 9508cc4eef Merge branch 'maint' 2015-10-24 11:39:09 +02:00
Nicolas Goaziou 9277e63352 ob-core: Fix "wrong-type-argument stringp nil"
* lisp/ob-core.el (org-babel-merge-params): Tolerate empty :exports
  parameter.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102005>
2015-10-24 11:37:46 +02:00
Kyle Meyer 666fd99175 Merge branch 'maint' 2015-10-23 11:19:16 -04:00
Kyle Meyer 8c763ab08c Restore behavior of '.' in org-read-date
* lisp/org.el (org-read-date-minibuffer-local-map): Fix period behavior
  broken by e802936.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102071>
2015-10-23 11:15:44 -04:00
Nick Dokos 30ec973c8b Fix org-bbdb-anniversaries-future.
Forgot the mapcar in commit 75f91f0bb7.
2015-10-20 21:10:52 -04:00
Oleh Krehel 481719fbd5 Clear non-repeated SCHEDULED when marking a repeated DEADLINE done
* lisp/org.el (org-auto-repeat-maybe): When a TODO has a DEADLINE
  that's repeatable, but SCHEDULED that isn't repeatable, clear the
  SCHEDULED after setting the current repeat to DONE.
  The repeatable SCHEDULED will be re-scheduled as before.

Reference:
http://stackoverflow.com/questions/18123972/emacs-org-mode-clear-non-repeated-scheduled-time-when-deadline-is-repeated
2015-10-19 14:03:58 +02:00
Nicolas Goaziou a709aed145 ox: Tiny refactoring 2015-10-18 23:06:08 +02:00
Nicolas Goaziou c2eeaca0ca ox: Preserve compatibility for Emacs 24.3 2015-10-18 11:02:51 +02:00
Nicolas Goaziou af4e118870 Merge branch 'maint' 2015-10-18 09:49:15 +02:00
Nicolas Goaziou 4e864643bd Fix `org-return-follows-link' on links with emphasis
* lisp/org.el (org-return): Properly follow links when description is
  emphasized.  Also tolerate links and timestamps in otherwise forbidden
  areas (e.g., comments, node properties...), much like
  `org-open-at-point'.

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

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101977>
2015-10-18 09:48:54 +02:00
Nicolas Goaziou 486d947761 Merge branch 'maint' 2015-10-18 09:28:30 +02:00
Nicolas Goaziou 8e4650c887 ox-ascii: Fix code typo
* lisp/ox-ascii.el (org-ascii--describe-links): Fix code typo introduced
  in d6a718a.
2015-10-18 09:27:28 +02:00
Nicolas Goaziou bf91460d39 Merge branch 'maint' 2015-10-18 01:41:21 +02:00
Nicolas Goaziou f01b3fadbc org-clock: Fix clock drawer creation
* lisp/org-clock.el (org-clock-find-position): Create clock drawer when
  a drawer is missing, even though requested, but some clocks are
  already present in the entry.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101973>
2015-10-18 01:39:36 +02:00
Nicolas Goaziou 158e40f58d Merge branch 'maint' 2015-10-18 00:03:36 +02:00
Nicolas Goaziou d6a718a93f ox-ascii: Fix external id links
* lisp/ox-ascii.el (org-ascii--describe-links): Fix export when id link
  targets an external file.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101978>
2015-10-18 00:02:31 +02:00
Nicolas Goaziou b369da2339 org-agenda: Fix last commit
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): Fix last commit.
2015-10-17 21:57:53 +02:00
Nicolas Goaziou 005aa06ed5 org-agenda: Skip SCHEDULED and DEADLINE false positives
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): Check point is really on a planning line
before proceeding.
2015-10-17 15:49:45 +02:00
Nicolas Goaziou 59761024b1 ox: Add an option to ignore broken links
* lisp/ox.el (org-export-with-broken-links): New variable.
(org-export-options-alist): Add new OPTIONS item.
(org-link-broken): New error type.
(org-export-resolve-coderef):
(org-export-resolve-fuzzy-link):
(org-export-resolve-id-link): Raise appropriate error symbol when a link
cannot be resolved.
(org-export-data): Handle new error type.

* doc/org.texi (Export settings): Document new feature.

* testing/lisp/test-ox.el (test-org-export/resolve-id-link):
(test-org-export/resolve-fuzzy-link):
(test-org-export/resolve-coderef): Update tests.
2015-10-17 14:42:07 +02:00
Nicolas Goaziou 707fbc3778 Merge branch 'maint' 2015-10-16 23:20:57 +02:00
Nicolas Goaziou 9de1ee1b6f org-element: Fix parsing of planning in inline tasks
* lisp/org-element.el (org-element--next-mode): Line following an
  inlinetask can be a planning.
* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
  Update test.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/101958>
2015-10-16 23:19:06 +02:00
Nicolas Goaziou fcb75f322a Merge branch 'maint' 2015-10-16 22:53:22 +02:00
Nicolas Goaziou 0ee8ba3e0d ox-beamer: Fix labels
* lisp/ox-beamer.el (org-beamer--get-label): Remove protective braces
  when extracting label from options.
(org-beamer--format-frame): Protect label with braces if it contains
colons.

Based off a patch from Fabrice
Popineau (<http://permalink.gmane.org/gmane.emacs.orgmode/101933>).
2015-10-16 22:38:14 +02:00
Nicolas Goaziou a427098b57 Change `org-agenda-repeating-timestamp-show-all' targets
* lisp/org.el (org-closest-date): Rewrite function with less arguments.
  Improve readability.
(org-time-string-to-absolute): Apply changes to `org-closest-date'.
Improve docstring.

* testing/lisp/test-org.el (test-org/closest-date): New test.

This change implies specific repeaters (i.e., ".+" and "++") are no
longer treated the same as regular one (i.e. "+") wrt
`org-agenda-repeating-timestamp-show-all'.  Indeed, only the latter
represents multiple dates.  The former represent another date only when
TODO state changes, which could then skip some occurrences.

This fixes issue raised at
<http://permalink.gmane.org/gmane.emacs.orgmode/101884> and
<http://article.gmane.org/gmane.emacs.orgmode/26154>.
2015-10-16 18:18:49 +02:00
Nicolas Goaziou e8f4488f43 ox-beamer: Obey to `org-latex-prefer-user-labels'
* lisp/ox-beamer.el (org-beamer--get-label): Obey to
  `org-latex-prefer-user-labels'.

Suggested-by: Fabrice Popineau <fabrice.popineau@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101894>
2015-10-15 10:33:27 +02:00
Nicolas Goaziou 96681fcb68 Merge branch 'maint' 2015-10-15 00:05:38 +02:00
Nicolas Goaziou a36c15494e org-clock: Fix quarterly clock reports
* lisp/org-clock.el (org-clock-special-range): Properly set Q according
  to block specification.

Reported-by: "L.C. Karssen" <lennart@karssen.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/101899>
2015-10-15 00:03:36 +02:00
Nicolas Goaziou 606b5fdd87 ox-publish: Fix void-variable project-plist
* lisp/ox-publish.el (org-publish-projects): Fix bug introduced in
  346d227.
2015-10-14 12:39:07 +02:00
Nicolas Goaziou fa61cb4079 Merge branch 'maint' 2015-10-13 23:57:48 +02:00
Nicolas Goaziou 1c7dca9692 ox-beamer: Fix againframe command
* lisp/ox-beamer.el (org-beamer-headline): Make sure any fuzzy reference
  provided for an againframe ends up pointing to a headline.
2015-10-13 23:51:17 +02:00
Nicolas Goaziou 5565645f75 Merge branch 'maint' 2015-10-13 21:44:13 +02:00
Jan Seeger d183c59e46 org-capture: Reverse capture finalize and refile, hack buffer killing
* org-capture.el (org-capture-refile): Call finalize first, then
  refile. If the capture buffer needs to be killed afterwards, kill
  after refiling.

Refiling before finalizing led to an incorrect cursor position during
refile.  Since adjusting the buffer position and bounds for the refiled
entry is difficult, I reverted the `org-capture-refile' function to its
original order of finalizing and then refiling.  However, this leads to
a bug with killing the buffer on capture, described in
<http://permalink.gmane.org/gmane.emacs.orgmode/78027/>.  To work around
this, now the :kill-buffer flag is cleared before calling finalize, and
the capture buffer is killed after `org-refile' is called.

TINYCHANGE
2015-10-13 21:42:47 +02:00
Nicolas Goaziou 346d227228 ox-publish: Call preparation function earlier
* lisp/ox-publish.el (org-publish-projects): Call preparation function
  earlier in the process, before files constituting the project are
  collected.

Suggested-by: Arun Isaac <theroarofthedragon@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101858>
2015-10-13 21:39:02 +02:00
Nick Dokos 75f91f0bb7 Allow early-warning anniversaries in agenda.
* lisp/org-bbdb.el (org-bbdb-anniversaries-future, org-bbdb-date-list): New functions.

* doc/org.texi: Document the usage of `org-bbdb-anniversaries-future'.

* etc/ORG-NEWS: Feature description.

Feature requested by Julien Cubizolles:

http://thread.gmane.org/gmane.emacs.orgmode/99344
2015-10-13 09:00:16 -04:00
Nicolas Goaziou 94f6b8e124 Merge branch 'maint' 2015-10-11 23:56:57 +02:00
Nicolas Goaziou c0c16b88fa ob-clojure: Silence byte-compiler 2015-10-11 23:56:35 +02:00
Nicolas Goaziou a898059dea Merge branch 'maint' 2015-10-11 23:32:07 +02:00
Feng Zhou 4eccd7c7b5 ob-clojure: Cider API change
* lisp/ob-clojure.el (org-babel-execute:clojure): Apply Cider API
  change.

TINYCHANGE
2015-10-11 23:31:23 +02:00
Nicolas Goaziou 50a18201c7 org-src: Preserve tab characters unrelated to indentation
* lisp/org-src.el (org-edit-src-code): Always preserve tabs not related
  to indentation.

* testing/lisp/test-org-src.el (test-org-src/preserve-tabs): New test.
2015-10-08 18:57:30 +02:00
Nicolas Goaziou 348890f79b org-element: Remove now useless function
* lisp/org-element.el (org-element-remove-indentation): Mark as
  an obsolete replacement for `org-remove-indentation'.
(org-element-example-block-parser):
(org-element-example-block-interpreter):
(org-element-src-block-parser):
* lisp/ox.el (org-export-unravel-code): Apply obsolescence.
2015-10-08 16:25:29 +02:00
Nicolas Goaziou 44cb8b1656 Remove maximum indentation without untabifying
* lisp/org.el (org-remove-indentation):
(org-do-remove-indentation): Change algorithm so as not to untabify
string or buffer.

Only <tab> characters used for indentation may be removed.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/101768>
2015-10-08 16:15:17 +02:00
Rasmus 718fee3049 ox-beamer: Support #+LATEX_COMPILER
* ox-beamer.el (org-beamer-template): Insert compiler and remove
  unused packages.
2015-10-04 15:54:28 +02:00
Rasmus 002499b26b ox-latex: Small refactor
* ox-latex.el (org-latex--make-preamble): Renamed
org-latex--make-header.
(org-latex--insert-compiler): New function.
(org-latex-template):
* ox-koma-letter.el: Use new function.
2015-10-04 15:54:28 +02:00
Rasmus bb51d25def ox-beamer: Remove numbers in template comments
* ox-beamer.el (org-beamer-template): Remove numbering of
  comments as it creates dependency between comments.
2015-10-04 15:54:28 +02:00
Rasmus 45b01819e0 Improve docstrings regarding latex_compiler
* org.el (org-latex-default-packages-alist):
* ox-latex.el (org-latex-compiler, org-latex-compilers)
  (org-latex-compiler-file-string, org-latex-bib-compiler)
  (org-latex--remove-packages): Improve docstring wrt. latex_compiler.
2015-10-04 15:54:21 +02:00
Kyle Meyer 984b1ff0ab Merge branch 'maint' 2015-10-04 02:46:23 -04:00
Kyle Meyer 00dacdcc50 Clean up spacing to pass Emacs's pre-commit check
This is in preparation for syncing with the Emacs repo.
2015-10-04 02:31:29 -04:00
Kyle Meyer e802936f4b Pass LIMIT argument to org-looking-back
* lisp/org-mouse.el (org-mouse-insert-item):
(org-mouse-context-menu):
* lisp/org-pcomplete.el (org-thing-at-point):
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-timestamp-change): Provide LIMIT argument to org-looking-back.
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-insert-heading): Replace looking-back with org-looking-back.

As of Emacs 25, the LIMIT argument to looking-back is advertised as a
required argument.
2015-10-04 02:31:29 -04:00
Kyle Meyer ef3ea9d02d Use prefix for outline functions
* lisp/ob-lilypond.el (org-babel-lilypond-mark-error-line):
* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-show-and-scroll-up):
(org-agenda-show-1):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-to-archive-sibling):
(org-toggle-archive-tag):
* lisp/org-capture.el:
(org-capture-place-template):
* lisp/org-colview.el:
(org-columns-eval):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org-mouse.el (org-mouse-popup-global-menu):
* lisp/org.el (org-cycle):
(org-cycle-internal-global):
(org-cycle-internal-local):
(org-global-cycle):
(org-set-startup-visibility):
(org-set-visibility-according-to-property):
(org-overview):
(org-content):
(org-clean-visibility-after-subtree-move):
(org-set-outline-overlay-data):
(org-tree-to-indirect-buffer):
(org-move-subtree-down):
(org-paste-subtree):
(org-sort-entries):
(orgstruct-setup):
(org-show-set-visibility):
(org-mode-map):
(org-check-before-invisible-edit):
(org-kill-note-or-show-branches):
(org-org-menu):
(org-yank-generic):
* lisp/ox-org.el (org-org-publish-to-org): Use prefix for outline
  functions.
* lisp/org-compat.el: Add compatibility functions for outline functions
  that are under the "outline-" prefix as of Emacs 25.
2015-10-04 02:31:16 -04:00
Kyle Meyer c8f2eec425 Merge branch 'maint' 2015-10-03 18:09:56 -04:00
Kyle Meyer 2c349cc65a ob-tangle: Check that publishing directory exists
* lisp/ob-tangle.el (org-babel-tangle-publish): Create publishing
  directory if it doesn't exist.

Reported-by: Arun Isaac <theroarofthedragon@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101697>
2015-10-03 18:08:52 -04:00
Nicolas Goaziou c2a0bfe580 Merge branch 'maint' 2015-10-03 09:22:41 +02:00
Nicolas Goaziou ee3d9363c5 ox: Change misleading keys in `org-export-smart-quotes-alist'
* lisp/ox.el (org-export-smart-quotes-alist):
(org-export--smart-quote-status): Change misleading quote names.

Due to the new smart quotes algorithm, "..." are always primary quotes,
even though they may be translated as single quotes.  Conversely, '...'
are secondary quotes and may not be translated to single quotes.
2015-10-03 09:19:21 +02:00
Kyle Meyer 24b05a5f54 Merge branch 'maint' 2015-10-02 23:21:59 -04:00
Kyle Meyer 36233d976d ob-tangle: Expand paths for publishing
* lisp/ob-tangle.el (org-babel-tangle-file): Return expanded file name.

Reported-by:  Arun Isaac <theroarofthedragon@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101290>
2015-10-02 23:19:57 -04:00
Nicolas Goaziou 0c591f327d Merge branch 'maint' 2015-10-01 21:56:29 +02:00
Nicolas Goaziou 609e1e28fb Fix "undefined symbol 'org-export-create-backend"
* lisp/org-table.el (orgtbl-to-generic): Make sure "ox.el" is loaded
  before converting a radio table.

Reported-by: Dave Marquardt <davemarq@linux.vnet.ibm.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101642>
2015-10-01 21:55:13 +02:00
Nicolas Goaziou a6350c4245 Merge branch 'maint' 2015-10-01 21:43:54 +02:00
Nicolas Goaziou 919d0cdb76 Fix "org-remove-if: Wrong type argument: number-or-marker-p, nil"
* lisp/org.el (org-remove-latex-fragment-image-overlays): Remove
  overlays not associated to a buffer.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101645>
2015-10-01 21:42:15 +02:00
Nicolas Goaziou 278804b8bf Merge branch 'maint' 2015-10-01 13:52:03 +02:00
Nicolas Goaziou 7273473e6b ox-icalendar: Fix a docstring
* lisp/ox-icalendar.el (org-icalendar-exclude-tags): Fix docstring.

Reported-by: james@jamestechnotes.com
<http://permalink.gmane.org/gmane.emacs.orgmode/101631>
2015-10-01 13:51:13 +02:00
Nicolas Goaziou b66fd12f4f Merge branch 'maint' 2015-09-30 13:56:11 +02:00
Hiroshi Saito 115c4bd5a7 org-feed.el: Substitute a guid XML element
* lisp/org-feed.el (org-feed-parse-rss-feed): Substitute a guid XML
element with `xml-substitute-special'.

TINYCHANGE
2015-09-30 13:55:23 +02:00
Rasmus 679adcaa64 ox-latex: Fix typo in 1e4b7e4bec
* ox-latex.el (org-latex--remove-packages): Fix typo.
2015-09-29 19:39:01 +02:00
Rasmus f6187deca5 ox-latex: Small refactor
* ox-latex.el (org-latex-compile): Use format-spec.
2015-09-27 23:49:32 +02:00
Rasmus 74da3bc10f ox-latex: Support arbitrary bibtex-like program
* ox-latex.el (org-latex-bib-compiler): New defcustom.
  (org-latex-pdf-process): Update docstring.
  (org-latex-compile): Use new defcustom.
* org.texi (@LaTeX{} and PDF export): Add documentation.
2015-09-27 23:49:32 +02:00
Rasmus 1e4b7e4bec ox-latex: Support changable TeX compilers
* org.el (org-latex-default-packages-alist): Only use inputenc
and fontenc in pdftex.
* ox-latex.el (latex): Add :latex-compiler.
(org-latex-compiler): New defcustom.
(org-latex-compilers): New defconst.
(org-latex--remove-packages): New function.
(org-latex-template): Use new function and variables.
(org-latex-pdf-process): Update to use %latex shorthand.
(org-latex-compile): Check and use intended compiler.
* org.texi (@LaTeX{} and PDF export): Document changes.
* ORG-NEWS: Add entry.

Adds #+latex_compiler: keyword.

Note, rubber is dropped from `org-latex-pdf-process' since it does not
allow arbitrary latex commands.

Suggested-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98921>
2015-09-27 23:49:32 +02:00
Nicolas Goaziou 6f2579b4fc Merge branch 'maint' 2015-09-26 00:14:36 +02:00
Nicolas Goaziou fd8a18151a Fix file uri
* lisp/ox.el (org-export-file-uri): Properly expand file uri.

* lisp/org-element.el (org-element-link-parser): Start path with "//"
  when referring to a remote file.

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

Reported-by: AW <alexander.willand@t-online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101471>
2015-09-26 00:11:42 +02:00
Nicolas Goaziou fe182cf0d7 Merge branch 'maint' 2015-09-24 10:27:47 +02:00
Nicolas Goaziou e68bc78ae4 ox-md: Fix docstring
* lisp/ox-md.el (org-md-separate-elements): Fix docstring.
2015-09-24 10:27:24 +02:00
Nicolas Goaziou d4aa7692bd Merge branch 'maint' 2015-09-24 10:19:38 +02:00
Richard Hansen 11bba63dc3 fix SETUPFILE pathname expansion with subdirectories
* lisp/org-macro.el (org-macro--collect-macros): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/org.el (org--setup-collect-keywords): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/ox.el (org-export--get-inbuffer-options,
org-export--list-bound-variables): cd to the directory containing the
SETUPFILE before recursing so that relative pathnames in the SETUPFILE
are expanded properly.

If /path/to/foo.org contains:

    #+SETUPFILE: settings/beamer.org

and /path/to/settings/beamer.org contains:

    #+SETUPFILE: common.org

then we want to read /path/to/settings/common.org, not
/path/to/common.org.

TINYCHANGE
2015-09-24 10:16:04 +02:00
Nicolas Goaziou e553ef2248 Make `org-show-children' interactive
* lisp/org.el (org-show-children): Make it a command.

Reported-by: Tokuya Kameshima <kametoku@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101347>
2015-09-24 00:01:39 +02:00