Commit Graph

17932 Commits

Author SHA1 Message Date
Nicolas Goaziou 6de8c94d8d org-footnote: Remove code for footnotes outside Org documents
* lisp/org-footnote.el (org-footnote-tag-for-non-org-mode-files): Remove
  variable.
(org-footnote-create-definition): Remove code for footnotes outside Org
documents. Small refactoring.
2015-12-22 16:55:17 +01:00
Nicolas Goaziou f229ee8e34 org-footnote: Fix references collection
* lisp/org-footnote.el (org-footnote--collect-references): Include
  inline references at the beginning of the line, which are allowed,
  unlike regular references.
2015-12-22 16:55:17 +01:00
Nicolas Goaziou 8eb318f2d0 org-footnote: Update library wrt new footnote syntax
* lisp/org-footnote.el (org-footnote-re):
(org-footnote-definition-re): Do not match [1]-like constructs.

(org-footnote): Fix typo.

(org-footnote-auto-label): Do not offer to create [1]-like constructs
anymore.

(org-footnote-new): Remove reference to obsolete value in
`org-footnote-auto-label'.

(org-footnote-at-reference-p):
(org-footnote-get-next-reference):
(org-footnote-next-reference-or-definition):
(org-footnote-goto-definition):
(org-footnote-goto-previous-reference): Use new regexp.

(org-footnote-normalize-label): Remove "fn:" prefix instead of adding
it.

(org-footnote-get-definition):
(org-footnote-all-labels):
(org-footnote-unique-label): Small refactoring.

(org-footnote-create-definition):
(org-footnote-delete-definitions):

(org-footnote--clear-footnote-section):
(org-footnote--collect-references):
(org-footnote--collect-definitions):
(org-footnote--set-label):
(org-footnote-sort): New functions.

(org-footnote-auto-adjust-maybe):
(org-footnote-action): Use new functions.  Small refactoring.

(org-footnote-renumber-fn:N): Refactor code.  Handle nested footnotes.

(org-footnote-normalize): Turn footnotes into [fn:N] construct instead
of [N].
* testing/lisp/test-org-footnote.el (test-org-footnote/delete):

(test-org-footnote/goto-definition):
(test-org-footnote/normalize): Update test

(test-org-footnote/sort):
(test-org-footnote/renumber-fn:N): New tests.

(test-org-footnote/normalize-outside-org): Remove test.
2015-12-22 16:55:17 +01:00
Nicolas Goaziou deafe56554 org-element: Ignore plain footnotes
* lisp/org-element.el (org-element--set-regexps):
(org-element-footnote-definition-interpreter):
(org-element-footnote-reference-parser):
(org-element-footnote-reference-interpreter): Do not consider [1]-like
constructs as footnotes anymore.

* lisp/ox.el (org-export-expand-include-keyword):
(org-export--prepare-file-contents): Apply changes to footnotes.

* doc/org.texi (Footnotes): Remove references to plain footnotes.

* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
(test-org-element/footnote-reference-interpreter):
* testing/lisp/test-ox.el (test-org-export/expand-include):
(test-org-export/expand-macro):
(test-org-export/get-footnote-number):
(test-org-export/collect-footnote-definitions):
(test-org-export/footnotes):
(test-org-export/fuzzy-link): Update tests.

Since it is possible to refer unambiguously to a label without the "fn:"
prefix, the latter becomes part of the syntax and no longer part of the
label.  In particular [fn:1] and [fn:label] are labelled, respectively,
"1" and "label".
2015-12-22 16:55:17 +01:00
Sacha Chua 25eb14bc2c org-protocol: Allow key=val&key2=val2-style URLs
* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Update documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like.  New-style links are of the form:
  org-protocol://store-link?title=TITLE&url=URL

* testing/lisp/test-org-protocol.el: New file.
2015-12-22 13:41:45 +01:00
Alan Schmitt 5aa12cd122 ob-ocaml.el: Keep echo to display ocaml errors
* ob-ocaml.el (org-babel-execute:ocaml): call
`org-babel-comint-with-output' with nil `remove-echo' argument.
2015-12-21 09:05:19 +01:00
Nicolas Goaziou 35bc1c8853 org-clock: Use lexical binding
* lisp/org-clock.el (org-clock-save-markers-for-cut-and-paste):
(org-clock-select-task):
(org-clock-out):
(org-clock-load): Use `dolist' instead of `mapc' + `lambda'.

(org-clock-insert-selection-line):
(org-resolve-clocks-if-idle):
(org-clock-find-position):
(org-clock-remove-overlays):
(org-dblock-write:clocktable):
(org-clocktable-steps):
(org-clock-get-table-data): Silence byte-compiler.
2015-12-20 23:04:48 +01:00
Nicolas Goaziou f090a2ae87 org-bibtex: Use lexical binding
* lisp/org-bibtex.el (org-bibtex-headline):
(org-bibtex): Silence byte-compiler.

(org-bibtex-create):
(org-bibtex-write): Use `dolist' instead of `mapc' + `lambda'.
2015-12-20 22:48:05 +01:00
Nicolas Goaziou 0e49899178 org-bbdb: Use lexical binding
* lisp/org-bbdb.el (org-bbdb-store-link):
(org-bbdb-open):
(org-bbdb-updated):
(org-bbdb-date-list): Silence byte-compiler.
2015-12-20 22:39:28 +01:00
Nicolas Goaziou 7875c3c498 org-docview: Use lexical binding
* lisp/org-docview.el (org-docview-store-link): Silence byte-compiler.
2015-12-20 22:15:41 +01:00
Nicolas Goaziou e82f48a8eb org-lint: Add checkers
* lisp/org-lint.el (org-lint-deprecated-export-blocks):
(org-lint-missing-backend-in-export-block):
(org-lint-obsolete-include-markup): New checkers.
2015-12-20 21:56:27 +01:00
Nicolas Goaziou 9f5a1ad51e org.texi: Update export blocks documentation
* doc/org.texi (Conventions):
(Include files):
(Special blocks):
(ASCII/Latin-1/UTF-8 export):
(Beamer specific syntax):
(Quoting HTML tags):
(Quoting @LaTeX{} code):
(Creating one-off styles):
(Quoting Texinfo code):
(Easy templates): Update export blocks documentation.
2015-12-20 21:56:27 +01:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Nicolas Goaziou 8c2e232b00 ob-sql: Fix `case' calls
* lisp/ob-sql.el (org-babel-execute:sql): Replace erroneous `case' call
  with `pcase'.  Small refactoring.  Keep lines within 80 characters.
2015-12-20 16:57:07 +01:00
Peter Feigl cf8bfc178d ob-sql.el: Add support for Oracle via sqlplus
* lisp/ob-sql.el: Add a database type 'oracle that uses sqlplus to
support running SQL blocks against an Oracle database.

Use with properties like this (all mandatory):
 :engine oracle :dbhost <host.com> :dbport <1521> :dbuser <username>
 :database <database> :dbpassword <secret>

TINYCHANGE
2015-12-20 16:54:21 +01:00
Thomas Alexander Gerds 73803c1cf9 org-gnus.el: change nnir group reference
* lisp/org-gnus.el (org-gnus-store-link): Articles in an nnir group
  refer to the original group.

TINYCHANGE
2015-12-18 22:42:32 +01:00
Nicolas Goaziou babcfaa4eb Merge branch 'maint' 2015-12-18 22:32:26 +01:00
Nicolas Goaziou 713fe873b7 org-table: Fix "$<" constructs in formulas
* lisp/org-table.el (org-table-recalculate): Expand "$<" without
  returning an error.  Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/first-rc): New test.

Reported-by: Stefan Nobis <stefan-ml@snobis.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103693>
2015-12-18 22:30:41 +01:00
Alan Schmitt e43d0abdd1 org-mac-link: Do not quote lambdas
* contrib/lisp/org-mac-link.el (org-mac-grab-link): Do not quote
  lambdas.
2015-12-18 11:28:39 +01:00
Mike McLean 2e251821ce org-mac-link.el: Add support for Evernote Note Links
(org-mac-grab-Evernote-app-p, org-mac-evernote-path): New custom
variables to control Evernote grabbing
(org-mac-evernote-note-open): New function to open an Evernote note by
ID
(org-as-get-selected-evernote-notes,
org-mac-evernote-note-insert-selected): New functions to get the
selected Evernote note(s) and insert them into current buffer

Note this change also defines a new link type ("mac-evernote") via a
call to “org-add-link-type”.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2015-12-18 11:21:33 +01:00
Mike McLean aee0498f3f org-mac-link.el: Make path to Microsoft Outlook customizable
* org-mac-link.el (org-mac-outlook-path): New Custom String to hold the file system path to Microsoft Outlook
(org-mac-outlook-message-open, org-as-get-selected-outlook-mail): Use
 the new custom string instead of hard-coding the path to Outlook

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2015-12-18 11:15:36 +01:00
Nicolas Goaziou 077fe86ad7 ob-latex: Properly declare :imagemagick header argument
* lisp/ob-latex.el (org-babel-header-args:latex): Declare :imagemagick.

Reported-by: Andreas Leha <andreas.leha@med.uni-goettingen.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103654>
2015-12-17 15:34:33 +01:00
Marco Wahl 986475a699 Merge branch 'maint' 2015-12-16 08:41:19 +01:00
Paul M. Rodriguez 5761580def org-velocity: New version of org-velocity.
* contrib/lisp/org-velocity.el: New version.
2015-12-16 08:39:43 +01:00
Nicolas Goaziou 0bdf4cedc5 Merge branch 'maint' 2015-12-15 00:03:57 +01:00
Thierry Banel cfb82b7c62 org-table: Fix missing dollar bug revealed by commit 16c7594
* org-table.el (orgtbl-ascii-plot): Add missing dollar in formula.
2015-12-14 23:55:17 +01:00
Nicolas Goaziou d01ed5b89b ox-html: Remove spurious # in some links
* lisp/ox-html.el (org-html-link): Remove spurious # introduced in
  8594aed.

Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/103599>
2015-12-14 23:52:11 +01:00
Kyle Meyer f57778090e Update for change in letrec behavior
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions):
* lisp/ox.el (org-export--selected-trees):
(org-export--prune-tree):
(org-export--merge-external-footnote-definitions):
(org-export--footnote-reference-map): Provide nil value for binders.

Using

  (letrec ((SYMBOL)) ...)

to bind SYMBOL to nil relies on (setq SYMBOL) setting SYMBOL to nil.  As
of 5d93a89 (Byte compiler: on setq with an odd number of arguments,
generate a `signal', 2015-11-26) in the Emacs repo, setq signals an
error when given an odd number of arguments.

Reported-by: Zack Piper <zack@apertron.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103539>
<http://permalink.gmane.org/gmane.emacs.devel/196182>
2015-12-12 22:46:24 -05:00
Marc Ihm d1796108f6 Version 5.0.0 of org-index 2015-12-12 22:36:13 +01:00
Marco Wahl 5ca98b9213 Merge branch 'maint' 2015-12-12 19:57:22 +01:00
Marco Wahl 700b8e70f6 org-agenda: Refactoring
* lisp/org-agenda.el(org-agenda--quit): Removed an unnecessary variable.
2015-12-12 19:46:34 +01:00
Marco Wahl 9b1c682425 org-agenda: Fix quit sticky agenda
* lisp/org-agenda.el(org-agenda--quit): Removed the argument from the
  call to `bury-buffer' to let the agenda disappear.
2015-12-12 19:35:26 +01:00
Nicolas Goaziou 8594aed1d6 ox-html: Always resolve external custom-id links
* lisp/ox-html.el (org-html-link): Always resolve external custom-id links.

Suggested-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/103552>
2015-12-12 09:57:51 +01:00
Nicolas Goaziou ce4143e79d Merge branch 'maint' 2015-12-12 00:41:43 +01:00
Nicolas Goaziou 7d1a6777d0 ox: Fix uninterpreted subscript
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Fix
  un-interpreted subscript containing another object.

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

Reported-by: Yasushi SHOJI <yashi@atmark-techno.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103553>
2015-12-12 00:38:39 +01:00
Nicolas Goaziou 64aee4692a org-list: Fix sending empty lists
* lisp/org-list.el (org-list--to-generic-item): Fix sending empty lists.

* testing/lisp/test-org-list.el (test-org-list/to-generic): Add test.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103462>
2015-12-08 18:45:21 +01:00
Nicolas Goaziou 38fd09e29b Fix code typo
* lisp/org.el (org-get-local-variables): Fix code typo.
2015-12-06 18:35:09 +01:00
Aaron Ecay a198d81080 Revert "Fix a slowdown in footnote parsing."
This reverts commit 046310d273.
2015-12-05 15:40:36 +00:00
Aaron Ecay 046310d273 Fix a slowdown in footnote parsing.
* lisp/org-footnote.el (org-footnote-in-valid-context-p): Fix slowdown.

Apply de Morgan’s law and reorder clauses from (apparently) quickest to
slowest.  See <http://mid.gmane.org/loom.20151204T081351-244@post.gmane.org>.
2015-12-05 13:41:33 +00:00
Nicolas Goaziou 7c08d5c12f ORG-NEWS: Fix an entry 2015-12-05 13:50:19 +01:00
Nicolas Goaziou d02f9d41af Ignore some local variables upon cloning
* lisp/org.el (org-unique-local-variables): New variable.
(org-get-local-variables):
(org-clone-local-variables): Use variable above.  Do not rely on an
obscure naming convention to determine if a local variable is meant to
be cloned or read.
2015-12-05 13:44:12 +01:00
Nicolas Goaziou dbaab40bda Obey to `org-inhibit-startup'
* lisp/org.el (org-mode): `org-startup-truncated' and
  `org-startup-indented' are expected to have an effect only when
  `org-inhibit-startup' is non-nil.
2015-12-05 13:36:41 +01:00
Nicolas Goaziou d6a169a82c org-capture: Fix cache in capture buffers
* lisp/org-capture.el (org-capture-steal-local-variables): Remove function.
(org-capture-fill-template): Apply removal.  Use
`org-clone-local-variables' instead.  Focus on Org specific variables.

* lisp/org.el (org-get-local-variables):
(org-clone-local-variables): Ignore internal local variables, whose
value is probably tied to their respective buffer.  In particular, this
prevents cache related variables from being copied.

* lisp/org-indent.el (org-indent--initial-marker): Renamed from
  `org-indent-initial-marker'.  Marking it as internal prevents it from
  being copied by `org-clone-local-variables' and alike.
(org-indent-mode):
(org-indent-initialize-buffer): Apply renaming.
2015-12-05 11:55:02 +01:00
Nicolas Goaziou 43009088b7 org-list: Silence byte-compiler (part 2) 2015-12-05 09:41:14 +01:00
Nicolas Goaziou 2beaeffef1 org-list: Silence byte-compiler 2015-12-05 09:38:49 +01:00
Nicolas Goaziou a682b20a46 org-capture: Use lexical binding
* lisp/org-capture.el (org-capture-is-refiling): New variable.
(org-capture-place-template): Silence byte-compiler.

* lisp/org.el (org-refile): Use new variable.
2015-12-05 09:30:17 +01:00
Nicolas Goaziou 9e1d625971 org-capture: Add missing %s placeholder
* lisp/org-capture.el (org-capture-fill-template): Add missing placeholder.
2015-12-05 09:25:06 +01:00
Nicolas Goaziou 9534b159e8 Merge branch 'maint' 2015-12-04 21:37:18 +01:00
Nicolas Goaziou 06c6ba4ac3 org-table: Fix named fields with TAB-indentation
* lisp/org-table.el (org-table-eval-formula): Properly parse named
  fields when indentation of current line ends with a TAB character.

* testing/lisp/test-org-table.el (test-org-table/tab-indent): New test.

Reported-by: Piotr Gajewski <pg7@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103290>
2015-12-04 21:34:40 +01:00
Marco Wahl 54f93be1d0 test-org-inlinetask: Testing inlinetasks
* testing/lisp/test-org-inlinetask.el: New file.  Testing
  `org-inlinetask-goto-end'.
2015-12-04 19:59:52 +01:00