Commit Graph

18824 Commits

Author SHA1 Message Date
Nicolas Goaziou 2f2e6625ac Work around a display bug when previewing LaTeX fragments
* lisp/org.el (org-format-latex): Change signature.
(org-toggle-latex-fragment):
* lisp/ox-html.el (org-html-format-latex): Apply signature change.
2016-06-23 00:33:22 +02:00
Nicolas Goaziou 24852ef060 Merge branch 'maint' 2016-06-22 22:43:19 +02:00
Nicolas Goaziou ecffcbcf1c Tiny fix to `org-set-effort'
* lisp/org.el (org-set-effort): Use `equal' instead of `string='.

Since (string= "nil" nil) is non-nil, a "nil" heading could be mistaken
for the current clocked task if `org-clock-current-task' is not bound,
or if there is no current clocked task.
2016-06-22 22:39:50 +02:00
Nicolas Goaziou 411524a31c Merge branch 'maint' 2016-06-22 22:38:07 +02:00
Nicolas Goaziou 2be2a15566 Merge branch 'maint' of orgmode.org:org-mode into maint 2016-06-22 22:36:22 +02:00
Nicolas Goaziou 85dd02b0dd ox: Fix export of empty footnote definitions outside scope
* lisp/ox.el (org-export-get-footnote-definition): When a definition is
  empty, but does exist, return the empty string instead of raising an
  error.
* testing/lisp/test-ox.el (test-org-export/get-footnote-definition): New
  test.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107873>
2016-06-22 22:34:53 +02:00
Nicolas Goaziou e33ca741c0 org.texi: Fix typo
* doc/org.texi (Sources and destinations): Add missing word.
2016-06-22 18:36:29 +02:00
Nicolas Goaziou 5cd793c59a ox-publish: Change signature for preparation and completion functions
* doc/org.texi (Sources and destinations): Document new signature.
* lisp/ox-publish.el (org-publish-project-alist): Update docstring.
(org-publish-projects): Call preparation and
completion functions with the project properties as the sole argument.

`project-plist' used to be dynamically scoped.  This is no longer
possible due to the switch to lexical binding.

Reported-by: Arun Isaac <arunisaac@systemreboot.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107856>
2016-06-22 15:31:48 +02:00
Nicolas Goaziou 6b7944805f org-mobile: Use lexical binding
* lisp/org-agenda.el (org-agenda-keep-restricted-file-list): New
  variable, dynamically scoped.
(org-agenda): Variable is now necessarily bound.

* lisp/org-mobile.el (org-mobile-create-index-file): Silence
  byte-compiler.
2016-06-22 00:01:10 +02:00
Nicolas Goaziou d87f4e1570 org-w3m: Use lexical binding 2016-06-21 23:41:41 +02:00
Nicolas Goaziou 11335f0ec0 org-rmail: Use lexical binding 2016-06-21 23:38:39 +02:00
Nicolas Goaziou 267af5e2fb org-protocol: Tiny clean up 2016-06-21 23:37:19 +02:00
Nicolas Goaziou 097edbfde4 org-protocol: Silence byte-compiler 2016-06-21 23:36:31 +02:00
Nicolas Goaziou 3dab837aef org-protocol: Use lexical binding
* lisp/org-protocol.el (org-protocol-store-link):
(org-protocol-open-source):
(org-protocol-check-filename-for-protocol):
(org-protocol-create): Silence byte-compiler.
2016-06-21 23:23:18 +02:00
Nicolas Goaziou 62d3d24f0b org-plot: Use lexical binding
* lisp/org-plot.el (org-plot/add-options-to-plist): Silence
  byte-compiler.
2016-06-21 23:19:11 +02:00
Nicolas Goaziou 313a97fca3 org-pcomplete: Small clean-up 2016-06-21 23:16:19 +02:00
Nicolas Goaziou b35d05ac2e org-pcomplete: Use lexical binding 2016-06-21 23:14:49 +02:00
Nicolas Goaziou 6bd701f44f org-mouse: Use lexical binding
* lisp/org-mouse.el (org-mouse-main-buffer): New dynamically scoped
  variable.
(org-mouse-replace-match-and-surround):
(org-mouse-for-each-item):
(org-mouse-move-tree-start):
(org-mouse-do-remotely):
(org-mouse-agenda-context-menu): Silence byte-compiler.
2016-06-21 23:12:23 +02:00
Nicolas Goaziou 994fe3e566 org-macs: Silence byte-compiler
* lisp/org-macs.el (org-save-outline-visibility): Remove unused symbol.
2016-06-21 23:02:35 +02:00
Nicolas Goaziou 3c5d215274 org-mhe: Use lexical binding 2016-06-21 23:01:52 +02:00
Nicolas Goaziou 5fcb15d976 org-macs: Use lexical binding
* lisp/org-macs.el (org-save-outline-visibility): Small refactoring.
2016-06-21 22:56:46 +02:00
Nicolas Goaziou b2835f3b8f org-irc: Use lexical binding
* lisp/org-irc.el (org-irc-ellipsify-description): Replace `mapc' +
  `lambda' with `dolist'.
2016-06-21 22:45:08 +02:00
Nicolas Goaziou 8d87417111 org-inlinetask: Use lexical binding 2016-06-21 22:42:09 +02:00
Nicolas Goaziou 26f0f938f4 org-info: Use lexical binding
* lisp/org-info.el (org-info-store-link): Small refactoring.
2016-06-21 22:38:51 +02:00
Nicolas Goaziou bb4b0d7efc org-gnus: Use lexical binding 2016-06-21 22:36:06 +02:00
Nicolas Goaziou b1c05d5169 org-eshell: Use lexical binding 2016-06-21 22:34:25 +02:00
Nicolas Goaziou c69fd5bf61 org-entities: Tiny refactoring
* lisp/org-entities.el (org-entities--user-safe-p): Use pattern matching
  and strengthen check for name.
2016-06-21 16:53:27 +02:00
Nicolas Goaziou 27c5cf153f org-entities: Use lexical binding
* lisp/org-entities.el (org-entities):
(org-entities-create-table):
(org-entities-help): Silence byte-compiler.
2016-06-21 16:40:08 +02:00
Nicolas Goaziou 4f63cfabb3 Deprecate `org-babel-trim' in favor of `org-trim'
* lisp/org.el (org-trim): Add optional argument.

* contrib/lisp/ob-mathematica.el (org-babel-execute:mathematica):
* contrib/lisp/org-bibtex-extras.el (obe-html-export-citations):
* contrib/lisp/org-mime.el (org-mime-compose):
* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-parse-multiple-vars):
(org-babel-read-element):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
(org-babel-trim): Mark obsolete.
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ref.el (org-babel-ref-split-args):
* lisp/ob-ruby.el (org-babel-ruby-evaluate):
* lisp/ob-shell.el (org-babel-sh-evaluate):
* lisp/ob-table.el (org-sbe):
* lisp/ob-tangle.el (org-babel-spec-to-string):
* lisp/org-bibtex.el (org-bibtex-get):
* testing/lisp/test-ob.el (test-ob/parse-header-args): Use `org-trim'
  instead of `org-babel-trim'.
2016-06-21 15:33:00 +02:00
Nicolas Goaziou 1c30dea0ec ob-core: Small refactoring
* lisp/ob-core.el (org-babel-get-src-block-info): Small refactoring.
2016-06-21 14:42:17 +02:00
Nicolas Goaziou f8eb0b30ea ob-shell: Fix "wrong type sequencep: function" error
* lisp/ob-shell.el (org-babel-shell-names): Fix error introduced when
  switching to lexical binding.
2016-06-20 22:12:02 +02:00
Nicolas Goaziou 47fdeb1f48 org-ctags: Do not require "cl" at compile time 2016-06-20 15:08:25 +02:00
Nicolas Goaziou 7d3380612f org-ctags: Use lexical binding
* lisp/org-ctags.el (org-ctags-open-file):
(org-ctags-fail-silently): Silence byte-compiler.
2016-06-20 15:04:33 +02:00
Nicolas Goaziou b67a3ff715 org-crypt: Use lexical binding 2016-06-20 15:00:47 +02:00
Nicolas Goaziou 2108f0c23a ob-shell: Use lexical binding
* lisp/ob-shell.el (org-babel-sh-initiate-session): Silence
  byte-compiler.
2016-06-20 14:58:32 +02:00
Nicolas Goaziou d4ea5decea ob-lob: Fix docstring
* lisp/ob-lob.el (org-babel-lob--src-info): Fix typo.
2016-06-20 14:47:22 +02:00
Nicolas Goaziou a5cf0f6fb8 ob-lob: Remove `org-babel-lob-files'
* lisp/ob-lob.el (org-babel-lob-files): Remove variable.
(org-babel-library-of-babel): Fix docstring.

Since its creation, `org-babel-lob-files' has been a no-op.  Since no-one
noticed it during those 7 years, it can safely be removed.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/107824>
2016-06-20 14:47:10 +02:00
Nicolas Goaziou bae2286393 ob-core: Tiny refactoring
* lisp/ob-core.el (org-babel-graphical-output-file): Refactor code.  Fix
  error messages.
2016-06-20 14:41:04 +02:00
Nicolas Goaziou 6cefae1637 ob-core: Use lexical binding
* lisp/ob-core.el (org-babel-get-src-block-info):
(org-babel-insert-header-arg):
(org-babel-enter-header-arg-w-completion):
(org-babel-params-from-properties):
(org-babel-process-params):
(org-babel-read): Use lexical scoping when eval'ing.
(org-babel-examplify-region): Silence byte-compiler.
(org-babel-merge-params):
(org-babel-noweb-p): Refactor code.
2016-06-20 14:35:16 +02:00
Kyle Meyer 160efb5129 Merge branch 'maint' 2016-06-19 14:18:10 -04:00
Kyle Meyer 792bb9b655 org-set-effort: Fix void variable error
* lisp/org.el (org-set-effort): Check if org-clock-current-task is
  defined because org-clock.el may not be loaded yet.
2016-06-19 14:11:25 -04:00
Kyle Meyer b237d4df04 org-set-effort: Remove extra space in prompt
* lisp/org.el (org-set-effort): Make spacing across different prompt
  cases consistent.  Simplify prompt concatenation.
2016-06-19 14:11:20 -04:00
Nicolas Goaziou 69552bd42f ob-tangle: Fix failing test on Emacs 24.3
* lisp/ob-tangle.el (org-babel-tangle): Do not use `add-to-list' on
  a let-bound symbol.
2016-06-19 00:57:03 +02:00
Nicolas Goaziou 65e9dcee8d ob-tangle: Use lexical binding
* lisp/ob-tangle.el (org-babel-process-comment-text):
(org-babel-spec-to-string):
(org-babel-tangle-single-block):
(org-babel-tangle-comment-links):
(org-babel-tangle-jump-to-org): Silence byte-compiler.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou 270ed02b02 ob-exp: Tiny refactoring
* lisp/ob-exp.el (org-export-babel-evaluate): Tiny refactoring.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou ce19c05e34 ob-exp: Use lexical binding
* lisp/ob-exp.el (org-babel-exp-src-block): Use `eval' with optional
  LEXICAL argument.
(org-babel-exp-process-buffer): Remove unused bindings.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou 72d4c3db2d ob-exp: Do not require `cl' at compile time
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use `pcase' instead of
  `case'.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou e1139e1895 ob-exp: Consolidate export of code blocks
* lisp/ob-exp.el (org-babel-exp--at-source): New macro.
(org-babel-exp-in-export-file): Remove macro.
(org-babel-exp-src-block): Remove unused argument.  Use new macro.
(org-babel-exp-process-buffer): Apply signature change above.  Put
temporary properties on top of Babel code so as to find original
location without relying on heuristics.
(org-babel-exp-results): Use new macro.

Export process has to know context of Babel code being evaluated (e.g.,
so as to retrieve parameters from node properties).  However, evaluating
previous code can drastically change the buffer.  The library used some
heuristics to find the original location.  Those are not necessary
anymore.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou cfaf0d54d7 ox: Remove `org-export-execute-babel-code'
* lisp/ox.el (org-export-execute-babel-code): Remove function.
(org-export-as): Replace previous function with
`org-babel-exp-process-buffer'.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Change signature.
  Copy buffer before evaluating code.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-export/export-with-results-before-block):
(ob-export/export-src-block-with-switches):
(ob-export/export-src-block-with-flags):
(ob-export/export-and-indentation):
(ob-export/export-under-commented-headline):
(ob-export/reference-in-post-header):
(ob-export/babel-evaluate):
(org-test-with-expanded-babel-code):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
(test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export): Apply
change.

This patch merges `org-export-execute-babel-code' within
`org-babel-exp-process-buffer', removing one level of indirection.  Now,
all the Babel evaluation is on the Babel side.
2016-06-18 22:11:14 +02:00
Nicolas Goaziou f195259821 Merge branch 'maint' 2016-06-17 14:17:23 +02:00