Commit Graph

280 Commits

Author SHA1 Message Date
Nicolas Goaziou 00ea6a286c ob-tangle: Fix last commit
* lisp/ob-tangle.el (org-babel-tangle-single-block):
  `org-babel-expand-noweb-references' specifically needs to be run in
  the Org document so as to resolve references.
* testing/lisp/test-ob-tangle.el (ob-tangle/continued-code-blocks-w-noweb-ref):
  Make sure a failing test doesn't leave a file behind it.
2016-12-10 00:59:08 +01:00
Nicolas Goaziou 7b148e2d0e ob-tangle: Respect buffer local variables
* lisp/ob-tangle.el (org-babel-spec-to-string): Move some processing...
(org-babel-tangle-single-block): ... there.  This function is called
with the Org buffer as its original buffer whereas the previous one is
not.

This is a follow-up to 026fb75, which was reverted.

Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110670>
2016-12-10 00:20:38 +01:00
Nicolas Goaziou 04799d8e39 Revert "ob-tangle: Respect buffer local variables"
This reverts commit 026fb75ddb.
2016-12-10 00:19:45 +01:00
Nicolas Goaziou 026fb75ddb ob-tangle: Respect buffer local variables
* lisp/ob-tangle.el (org-babel-tangle): Make sure buffer local
  variables from Org document are taken into consideration in tangled
  document.

Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110577>
2016-12-03 23:55:28 +01:00
Marco Wahl ece6e39dfc ob-tangle: Fix jump from tangle to org
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Fix the jump from a
  tangled part to the respective org in the case when an org-id defines
  the linking.

  The recent (buggy) behavior was to find the file which has the org-id as
  filename.
2016-09-28 14:07:56 +02:00
Aaron Ecay 79650ffbbd Use assq instead of assoc for :keywords
* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-J.el (org-babel-execute:J):
* lisp/ob-R.el (org-babel-edit-prep:R):
(org-babel-expand-body:R):
(org-babel-execute:R):
(org-babel-variable-assignments:R):
(org-babel-R-initiate-session):
* lisp/ob-abc.el (org-babel-execute:abc):
* lisp/ob-asymptote.el (org-babel-execute:asymptote):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
(org-babel-execute:clojure):
* lisp/ob-core.el (org-babel-expand-body:generic):
(org-babel-load-in-session):
(org-babel-initiate-session):
(org-babel-open-src-block-result):
(org-babel-process-params):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-dot.el (org-babel-execute:dot):
* lisp/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp):
(org-babel-execute:emacs-lisp):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-do-export):
(org-babel-exp-code):
* lisp/ob-forth.el (org-babel-execute:forth):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars):
(org-babel-expand-body:gnuplot):
(org-babel-execute:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-io.el (org-babel-execute:io):
* lisp/ob-java.el (org-babel-execute:java):
* lisp/ob-js.el (org-babel-execute:js):
* lisp/ob-latex.el (org-babel-execute:latex):
* lisp/ob-ledger.el (org-babel-execute:ledger):
* lisp/ob-lilypond.el (org-babel-lilypond-process-basic):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
(org-babel-execute:lisp):
* lisp/ob-lua.el (org-babel-execute:lua):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-mscgen.el (org-babel-execute:mscgen):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-execute:octave):
* lisp/ob-org.el (org-babel-execute:org):
* lisp/ob-perl.el (org-babel-execute:perl):
* lisp/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/ob-plantuml.el (org-babel-execute:plantuml):
* lisp/ob-python.el (org-babel-execute:python):
* lisp/ob-ruby.el (org-babel-execute:ruby):
* lisp/ob-sass.el (org-babel-execute:sass):
* lisp/ob-scala.el (org-babel-execute:scala):
* lisp/ob-scheme.el (org-babel-execute:scheme):
* lisp/ob-screen.el (org-babel-execute:screen):
(org-babel-prep-session:screen):
* lisp/ob-shell.el (org-babel-execute:shell):
(org-babel-variable-assignments:shell):
(org-babel-sh-evaluate):
* lisp/ob-shen.el (org-babel-execute:shen):
* lisp/ob-sql.el (org-babel-execute:sql):
* lisp/ob-sqlite.el (org-babel-execute:sqlite):
* lisp/ob-tangle.el (org-babel-tangle):
(org-babel-tangle-single-block):
* lisp/org-src.el (org-src-associate-babel-session):
* lisp/org.el (org-next-link):
Use `assq' instead of `assoc' with :keyword keys.
2016-09-23 11:20:09 +01:00
Aaron Ecay d350baf2db babel: change single-armed ‘if’ statements to ‘when’
* lisp/ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-hide-result-toggle):
(org-babel-insert-result):
* lisp/ob-eval.el (org-babel--shell-command-on-region):
* lisp/ob-table.el (org-babel-table-truncate-at-newline):
* lisp/ob-tangle.el (org-babel-tangle):
Change `if' without else to `when'.
2016-09-03 02:45:27 +01:00
Nicolas Goaziou de24694f05 Turn org-mode into Org or Org mode
Use Org or Org mode instead of org-mode or Org-mode according to
"Documentation standards".
2016-08-23 22:13:56 +02:00
Nicolas Goaziou c4da20a2f3 Silence byte-compiler
* lisp/ob-core.el (org-babel-process-params): Silence byte-compiler.
* lisp/ob-groovy.el (org-babel-groovy-evaluate):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-io.el (org-babel-io-evaluate):
* lisp/ob-octave.el (org-babel-octave-evaluate-external-process):
(org-babel-octave-evaluate-session):
* lisp/ob-perl.el (org-babel-perl-evaluate):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ruby.el (org-babel-ruby-pp-wrapper-method):
(org-babel-ruby-evaluate):
* lisp/ob-scala.el:
* lisp/ob-tangle.el:
(org-babel-tangle-collect-blocks):
* lisp/org-agenda.el (org-agenda-get-category-icon):
(org-agenda-todo-yesterday):
* lisp/org-bbdb.el (org-bbdb-anniv-extract-date):
(org-bbdb-make-anniv-hash):
(org-bbdb-anniversaries-future):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-read):
(org-bibtex-write):
* lisp/org-capture.el (org-capture-set-target-location):
(org-capture-get-indirect-buffer):
(org-mks):
* lisp/org-clock.el (org-clock--oldest-date):
(org-clock-resolve):
(org-clock-sum):
(org-clock-special-range):
(org-clocktable-steps):
* lisp/org-ctags.el (org-ctags-create-tags):
* lisp/org-element.el (org-element--interpret-affiliated-keywords):
(org-element--cache-shift-positions):
(org-element--cache-sync):
(org-element--cache-submit-request):
* lisp/org-habit.el (org-habit-parse-todo):
* lisp/org-inlinetask.el (org-inlinetask-hide-tasks):
* lisp/org-lint.el (org-lint--generate-reports):
* lisp/org-mouse.el (org-mouse-get-context):
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
(org-plot/gnuplot):
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii--current-justification):
(org-ascii--build-caption):
(org-ascii--checkbox):
(org-ascii-item):
* lisp/ox-html.el (org-html-footnote-section):
* lisp/ox-latex.el (org-latex--make-option-string):
* lisp/ox-odt.el (org-odt-toc):
(org-odt-add-automatic-style):
(org-odt-format-label):
(org-odt-link--inline-image):
(org-odt--render-image/formula):
(org-odt--enumerable-image-p):
(org-odt--enumerable-latex-image-p):
(org-odt--enumerable-formula-p):
(org-odt-do-format-code):
(org-odt-table-cell): Silence byte-compiler.
2016-07-25 17:10:53 +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 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
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
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 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 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 a03175d6d9 ob-tangle: Silence byte-compiler 2016-01-02 17:40:22 +01:00
Nicolas Goaziou 59f00529d4 Update copyright years 2016-01-02 17:06:30 +01:00
Nicolas Goaziou e2ac979d9e ob-tangle: Fix commented links
* lisp/ob-tangle.el (org-babel-spec-to-string):
(org-babel-tangle-collect-blocks): Fix numbering and relative path of
commented links.

* testing/lisp/test-ob-tangle.el (ob-tangle/comment-links-numbering):
  New test.

Reported-by: Tobias Müller <mllertobias@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103861>
2016-01-02 17:05:00 +01: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
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
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Nicolas Goaziou 62dc515ae5 ob-tangle: Fix commenting links at column 0
* lisp/ob-tangle.el (org-babel-spec-to-string): Ignore invisible
  characters when commenting in destination file.

* testing/lisp/test-ob-tangle.el (ob-tangle/comment-links-at-left-margin):
New test.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101002>
2015-09-10 11:12:20 +02:00
Kyle Meyer 85e0c1ce75 Fix tangling in indirect buffers
* lisp/ob-tangle.el (org-babel-tangle-single-block): Get file name from
  base buffer.
(org-babel-tangle): Use file name from attribute list returned by
org-babel-tangle-single-block.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/100845>
2015-09-09 09:54:18 -04:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Nicolas Goaziou 626caa4e9e ob-tangle: Silence byte-compiler 2015-06-16 00:09:20 +02:00
Nicolas Goaziou 90df55ea7b ob-tangle: Small refactoring
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Refactor.
2015-06-15 21:38:14 +02:00
Eric Schulte a3745c375b tangle option to not post-process tangle comments
* lisp/ob-tangle.el (org-babel-tangle-comment-format-beg): Mention the
  new `org-babel-tangle-uncomment-comments' variable in the
  documentation.
  (org-babel-tangle-comment-format-end): Mention the new
  `org-babel-tangle-uncomment-comments' variable in the documentation.
  (org-babel-tangle-uncomment-comments): New customization variable to
  inhibit the post-processing of tangle comments.
  (org-babel-spec-to-string): Post-processing of tangle comments is
  now dependent upon a customization variable.
2014-06-07 11:29:03 -04:00
Achim Gratz e8e8f6738a Merge branch 'maint' 2014-05-03 10:15:42 +02:00
Achim Gratz 063c8b03b7 ob-tangle: do not run make-directory with nil argument
* lisp/ob-tangle.el (org-babel-tangle): When `file-name-directory'
  returns nil, do not run make-directory.  Remove superfluous when
  clauses by using short-circuiting `and' instead.

Thanks to R. Michael Weylandt for reporting the problem and offering a
patch.

http://permalink.gmane.org/gmane.emacs.orgmode/85749
http://permalink.gmane.org/gmane.emacs.orgmode/85774
2014-05-03 10:12:10 +02:00
Bastien Guerry 6175be9487 Revert "ob-tangle.el (org-babel-spec-to-string): Don't use `org-babel-trim"
This reverts commit a13e133f5a.
2014-04-19 14:54:48 +02:00
Bastien Guerry a13e133f5a ob-tangle.el (org-babel-spec-to-string): Don't use `org-babel-trim
* ob-tangle.el (org-babel-spec-to-string): Don't use
`org-babel-trim'.
2014-04-18 14:49:21 +02:00
Nicolas Goaziou ad16ef42da Silence byte-compiler 2014-03-24 21:07:43 +01:00
Nicolas Goaziou 6d1d61f667 Rename `org-babel-under-commented-heading-p'
* lisp/org.el (org-in-commented-heading-p): New function.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Remove
  function.
(org-babel-tangle-collect-blocks): Use new function.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use new function.

* testing/lisp/test-org.el (test-org/in-commented-heading-p): New
  test.
2014-03-24 13:29:42 -04:00
Nicolas Goaziou 7ae45b5331 ob-tangle: Fix `org-babel-under-commented-heading-p'
* lisp/ob-tangle.el (org-babel-under-commented-heading-p):
  `org-comment-string' is case sensitive and cannot be attached to
  other text.
2014-03-15 19:40:08 -06:00
Nicolas Richard ec33c0cf9e lisp/ob-tangle.el: "elisp" should get tangled to ".el" files.
TINYCHANGE
2014-03-06 14:58:12 -07:00
Bastien Guerry 23fa320af8 ob-tangle.el: Fix compiler warning 2014-01-31 09:43:46 +01:00
Bastien Guerry 9368d317fb ob-tangle.el (org-babel-under-commented-heading-p): Throw nil when called before the first heading
* ob-tangle.el (org-babel-under-commented-heading-p): Throw
nil when called before the first heading.

Thanks to John Kitchin for reporting this.
2014-01-30 00:57:24 +01:00
Bastien Guerry f8e1745440 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-07 14:19:03 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Eric Schulte 39070b7fc7 sometimes remove common indentation when trimming
* lisp/ob-C.el (org-babel-C-execute): Remove common indentation when
  trimming.

* lisp/ob-core.el (org-babel-read-result): Remove common indentation
  when trimming.
  (org-babel-update-block-body): Remove common indentation when
  trimming.

* lisp/ob-fortran.el (org-babel-execute:fortran): Remove common
  indentation when trimming.

* lisp/ob-tangle.el (org-babel-process-comment-text): Better default
  to process tangled comments.
2013-11-23 15:57:29 -07:00
Achim Gratz 54a64f50b5 ob-C, ob-clojure, ob-tangle, org-agenda, org, ox: fix byte-compiler warnings
* lisp/ob-C.el, lisp/ob-clojure.e: Require 'cl at compile-time.
* lisp/ob-tangle.el: Do not require 'cl at compile time.
* lisp/org-agenda.el: Declare function `org-columns-remove-overlays´.
* lisp/org.el: Declare functions `org-clocktable-shift´,
  `org-clock-update-time-maybe´, `org-clock-remove-overlays´,
  `org-babel-tangle-file´, `org-table-blank-field´,
  `org-table-insert-row´, `org-add-archive-files´, `org-table-begin´,
  `org-table-end´.  Move defsubst `org-uniquify´ before its many uses.
* lisp/ox.el: Move defsubst `org-export-get-parent´ before its many
  uses.
2013-11-15 20:18:58 +01:00
Bastien Guerry 71884cc039 Merge branch 'maint'
Conflicts:
	lisp/ob-C.el
	lisp/ob-clojure.el
	lisp/ob-core.el
	lisp/ob-lisp.el
	lisp/org-clock.el
2013-11-12 21:00:49 +01:00
Bastien Guerry f95641c443 Backport changes from Emacs revs 115081 and 115082
2013-11-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	Address some byte-compiler warnings.
	* ob-abc.el (org-babel-expand-body:abc): Use dolist.
	(org-babel-execute:abc): Fix regexp quoting.
	* ob-calc.el (org--var-syms): Rename from `var-syms'.
	* ob-lilypond.el (ly-compile-lilyfile): Remove redundant let-binding.
	* ob-table.el (sbe): Move debug declaration.
	* org-clock.el (org--msg-extra): Rename from `msg-extra'.
	* org.el (org-version): Avoid var name starting with _.
	(org-inhibit-startup, org-called-with-limited-levels)
	(org-link-search-inhibit-query, org-time-was-given)
	(org-end-time-was-given, org-def, org-defdecode, org-with-time):
	* org-colview.el (org-agenda-overriding-columns-format):
	* org-agenda.el (org-agenda-multi, org-depend-tag-blocked)
	(org-agenda-show-log-scoped):
	* ob-python.el (py-which-bufname, python-shell-buffer-name):
	* ob-haskell.el (org-export-copy-to-kill-ring):
	* ob-exp.el (org-link-search-inhibit-query):
	* ob-R.el (ess-eval-visibly-p):
	* ob-core.el (org-src-window-setup): Declare before use.
	(org-babel-expand-noweb-references): Remove unused `blocks-in-buffer'.
	* ox-odt.el (org-odt-hfy-face-to-css):
	* org-src.el (org-src-associate-babel-session, org-src-get-lang-mode):
	* org-bibtex.el (org-bibtex-get, org-bibtex-ask, org-bibtex)
	(org-bibtex-check):
	* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string)
	(org-babel-tangle-single-block, org-babel-tangle-comment-links):
	* ob-table.el (sbe):
	* ob-sqlite.el (org-babel-sqlite-expand-vars):
	* ob-sql.el (org-babel-sql-expand-vars):
	* ob-shen.el (org-babel-execute:shen):
	* ob-sh.el (org-babel-execute:sh, org-babel-sh-evaluate):
	* ob-scala.el (org-babel-scala-evaluate):
	* ob-ruby.el (org-babel-ruby-table-or-string)
	(org-babel-ruby-evaluate):
	* ob-python.el (org-babel-python-table-or-string)
	(org-babel-python-evaluate-external-process)
	(org-babel-python-evaluate-session):
	* ob-picolisp.el (org-babel-execute:picolisp):
	* ob-perl.el (org-babel-perl-evaluate):
	* ob-maxima.el (org-babel-execute:maxima):
	* ob-lisp.el (org-babel-execute:lisp):
	* ob-java.el (org-babel-execute:java):
	* ob-io.el (org-babel-io-evaluate):
	* ob-haskell.el (org-babel-execute:haskell):
	* ob-fortran.el (org-babel-execute:fortran):
	* ob-exp.el (org-babel-exp-code):
	* ob-emacs-lisp.el (org-babel-execute:emacs-lisp):
	* ob-ditaa.el (org-babel-execute:ditaa):
	* ob-core.el (org-babel-execute-src-block, org-babel-sha1-hash)
	(org-babel-parse-header-arguments, org-babel-reassemble-table)
	(org-babel-goto-src-block-head, org-babel-mark-block)
	(org-babel-expand-noweb-references, org-babel-script-escape)
	(org-babel-process-file-name):
	* ob-clojure.el (org-babel-execute:clojure):
	* ob-calc.el (org-babel-execute:calc):
	* ob-awk.el (org-babel-execute:awk):
	* ob-abc.el (org-babel-execute:abc):
	* ob-R.el (org-babel-expand-body:R):
	* ob-C.el (org-babel-C-execute): Avoid deprecated ((lambda) ...).

2013-11-12  Glenn Morris  <rgm@gnu.org>

	* ox-html.el (org-html-scripts): Add 2013 to copyright years.
	(org-html-infojs-template): Copyright holder to FSF.
2013-11-12 20:57:31 +01:00
Eric Schulte e4984e2783 fix tangle bug, checking empty headlines commented
Thanks to Michael Brand for catching this bug.

* lisp/ob-tangle.el (org-babel-under-commented-heading-p): robust to
  empty headlines.
2013-11-11 13:54:21 -07:00
Bastien Guerry 2ac57db0a3 Merge branch 'maint' 2013-11-04 12:20:20 +01:00
Bastien Guerry 56d405a41c org.el (org-babel-load-file): Set `exported-file' correctly
* org.el (org-babel-load-file): Set `exported-file' correctly,
in case the file as been tangled using a buffer-local value.

* ob-tangle.el (org-babel-tangle-file): Return the list of
tangled files.

Thanks to Sam Flint for reporting this.
2013-11-04 12:19:45 +01:00
Aaron Ecay a94501a132 babel: don’t move point when tangling a single block
* lisp/ob-tangle.el: (org-babel-tangle): don’t move point when called
with single prefix arg

Previously, C-u C-x C-v C-t would move point to the head of the source block.
2013-10-31 01:54:53 -04:00
Nicolas Goaziou bdbf80aacb ob-tangle: Silence byte-compiler 2013-10-27 09:54:27 +01:00
Eric Schulte 7a17f8a5a7 fix typo in `org-babel-under-commented-heading-p'
Thanks to Alan Schmitt for pointing this out.

* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Fix name
  typo.
2013-10-20 15:56:20 -06:00
Eric Schulte af80144976 tangle checks for COMMENT in parent headlines
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Check if
  the point is under a commented heading (including parents).
  (org-babel-tangle-collect-blocks): Don't tangle blocks is under a
  commented heading (including parents).
2013-10-19 15:53:39 -06:00
Eric Schulte be3dad300f re-apply an orphaned anonymous lambda function
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Re-apply an
  orphaned anonymous lambda function.
2013-10-09 10:29:01 -06:00
Eric Schulte 15847336c3 tangled links use relative paths by default
* lisp/ob-tangle.el (org-babel-tangle-use-relative-file-links):
  Controls the use of relative paths in files and links in tangled
  source code.
  (org-babel-spec-to-string): Optionally use relative paths in files
  and links.
2013-10-09 10:29:01 -06:00
Vladimir Lomov 11498bf86f remove dangling 'padline' variable
And seems that you miss another 'padline' in function
'org-babel-spec-to-string', line 323. I attached small patch which
removes that line so I can tangle Org document with shell scripts.

* lisp/ob-tangle.el (org-babel-spec-to-string): Remove dangling
  'padline' variable.

TINYPATCH
2013-10-01 06:00:44 -06:00
Eric Schulte ae21350aaa :padline insertion aware of placement in file
* lisp/ob-tangle.el (org-babel-spec-to-string): Remove padline
  handling from here as there is insufficient information on context.
  (org-babel-tangle): Moved padline handling here where we can test
  for placement in the file.
2013-09-28 06:15:42 -06:00
Eric Schulte 6f90d903e6 Revert "don't insert a padline at the top of the file"
This reverts commit 6215960d99.
2013-09-28 06:11:36 -06:00
Eric Schulte 6215960d99 don't insert a padline at the top of the file
* lisp/ob-tangle.el (org-babel-spec-to-string): Don't insert a padline
  at the top of the file, instead only insert padlines between blocks.
2013-09-20 15:25:36 -06:00
Eric Schulte 1a8ad7dab1 fixed bug in tangle-file
* lisp/ob-tangle.el (org-babel-tangle): Fixed bug in tangle-file.
2013-06-11 11:59:43 -06:00
Eric Schulte 5c6f4fd130 change file modes once after tangling
* lisp/ob-tangle.el (org-babel-tangle): Collect tangle modes, and only
  apply them to the file after all tangling has completed, including the
  post-tangle-hook.
2013-06-10 09:56:43 -06:00
Eric Schulte 2a73e06a6d adding a new global tangle-mode header argument
* doc/org.texi (Top): Documentation for new tangle-mode header argument.
  (Specific header arguments): Documentation for new tangle-mode header
  argument.
  (rownames): Documentation for new tangle-mode header argument.
  (tangle-mode): Documentation for new tangle-mode header argument.

* lisp/ob-core.el (org-babel-common-header-args-w-values): Adding the
  new :tangle-mode header argument.
  (org-babel-read): Read values starting with a "#" character as emacs
  lisp.

* lisp/ob-tangle.el (org-babel-tangle): Use the new :tangle-mode header
  argument.

* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Use the
  new :tangle-mode header argument.
2013-06-08 12:29:02 -06:00
Vitalie Spinu 6043de578f avoid file warnings in org-babel-post-tangle-hook
* lisp/ob-tangle.el (org-babel-find-file-noselect-refresh): call
  find-file-noselect with 'nowarn argument to surpress yes-or-no-p
  reversion message.
2013-06-07 07:23:16 -06:00
Eric Schulte bceb151b7e `org-src-switch-to-buffer' to jump from src to org
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Use
  `org-src-switch-to-buffer' to jump from src to org.
2013-06-06 09:11:54 -06:00
Achim Gratz d36a933c65 Compatibility: fix XEmacs compilation failures
* lisp/ob-eval.el, lisp/ob.el, lisp/org-macro.el, lisp/org-mhe.el:
  Require org-macs and org-compat as necessary.
* lisp/ob-tangle.el: Declare function `org-store-link' and
  `org-open-link-from-string'.
* lisp/org-compat.el: Extend eval-and-compile clause and add advices
  for functions that have different parameter lists in XEmacs. Add
  variable definitions that XEmacs lacks .
* lisp/org-macs.el (declare-function): Define macro to use autoload
  instead for XEmacs.
* lisp/ox-html.el, lisp/ox-odt.el: XEmacs does not have table.el, so
  use 'noerror on the require form.
* lisp/ox-texinfo.el (org-texinfo-table-column-widths): Fix spliced
  argument list that XEmacs complains about by adding parenthesis.

This fixes all compilation failures on XEmacs and warnings related to
Org that indicate that XEmacs has compiled things wrongly (for
instance it might have interpreted a function as a variable symbol).
There are still many warnings that probably indicate serious problems.
2013-06-01 11:31:07 +02:00
Achim Gratz 0e42f1aae1 ob-tangle: declare org-edit-special
* lisp/ob-tangle.el (org-edit-special): Declare function.

Fixes a byte-compiler warning introduced in d9cfec3040.
2013-06-01 11:31:07 +02:00
Eric Schulte d9cfec3040 jump back to the correct point in the code block
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Use the existing
  org-edit-src functionality to jump back to the correct point in the
  code block in the original Org-mode buffer.
2013-05-30 18:03:33 -04:00
Aaron Ecay 7263b326d4 Add 'light argument to some uses of org-babel-get-src-block-info
* lisp/ob-core.el (org-babel-do-key-sequence-in-edit-buffer)
(org-babel-expand-noweb-references)
* lisp/ob-tangle.el (org-babel-tangle): Use 'light argument to
`org-babel-get-src-block-info'.
2013-04-21 23:45:27 -04:00
Bastien Guerry d5fd2008e3 org.el (org-babel-load-file): Move `org-babel-load-file' here
* org.el (org-babel-load-file): Move `org-babel-load-file'
from ob-tangle.el to here so that it is correctly autoloaded
by Emacs before Org is required.

Thanks to Eric Schulte for feedback about this.
2013-04-05 08:37:51 +02:00
Eric Schulte 10a67d594a update doc to reflect changed variable name
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Update comment to
  reflect changed variable name.
2013-03-04 06:44:31 -07:00
Ryo TAKAISHI 8ef0eb467f fix bug: org-babel-tangle-file can't limit collected source code block by argument.
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Change argument
  name collid org-babel-map-src-blocks's variable 'lang'.

TINYCHANGE
2013-03-04 06:44:11 -07:00
Bastien Guerry 71e9b321ec Merge branch 'master-wip3' 2013-03-02 18:59:55 +01:00
Achim Gratz 3773029db9 fix 17131cbf63
* lisp/ob-tangle.el (org-babel-tangle): Do not change signature, a nil
  arg is even documented in the manual.
* lisp/org-src.el: Change declaration of `org-babel-tangle´ to "arg"
  for first argument.
2013-03-02 18:13:52 +01:00
Bastien Guerry aa3091580d ob-tangle.el: A small fix and some refactoring
* ob-tangle.el (org-babel-tangle): Remove unused attempt of
prompting the user of the tangle file name since :tangle is
always set.  Don't prompt for a tangle file name when called
with two universal prefix arg outside of a src block.
Use `org-babel-tangle-single-block'.
(org-babel-tangle-single-block): New function.
(org-babel-tangle-collect-blocks): Use the new function.

Thanks to Rick Frankel who provided a patch for this fix.
The patch fixes this issue (quoting Rick's email):

"When attempting to tangle a single block, `org-babel-tangle'
would use `narrow-to-region', causing any header arguments not
on the "#+BEGIN_SRC" line to be excluded from the tangled file."
2013-03-02 17:15:08 +01:00
Bastien Guerry 17131cbf63 ob-tangle.el (org-babel-tangle): Allow two universal prefix arguments to tangle by the target file of the block at point
* ob-tangle.el (org-babel-tangle): Rename the ONLY-THIS-BLOCK
parameter to ARG.  Allow two universal prefix arguments to
tangle by the target file of the block at point.
(org-babel-tangle-collect-blocks): New parameter TANGLE-FILE
to restrict the collection of blocks to those who will be
tangled in TARGET-FILE.

Thanks to Zech for suggesting this.
2013-03-02 15:27:25 +01:00
Nicolas Goaziou 8ef19cdeee ob-tangle: Correctly unescape code when tangling
* lisp/ob-tangle.el (org-babel-spec-to-string): Use dedicated function
  for unescaping code.
2013-03-02 10:07:37 +01:00
Bastien Guerry e48f13423a Fix compiler warnings 2013-03-01 15:50:05 +01:00
Bastien Guerry 8e0b4529f7 ob-tangle.el (org-babel-tangle-collect-blocks): Don't collect blocks in commented out headings
* ob-tangle.el (org-babel-tangle-collect-blocks): Don't
collect blocks in commented out headings.

Thansk to the various people who requested this.
2013-02-28 10:25:21 +01:00
Bastien Guerry a6ac2b5fed Merge branch 'maint' 2013-02-13 15:15:53 +01:00
Bastien Guerry fa3385e68b ob-tangle.el (org-babel-tangle-collect-blocks): Bugfix: remove code references from blocks
* ob-tangle.el (org-babel-tangle-collect-blocks): Bugfix:
remove code references from blocks.

Thanks a lot to Michael Alan Dorman for reporting this.
2013-02-13 15:15:42 +01:00
Eric Schulte f52600a439 fix bug: tangling #+headers: lines w/prefix arg 2013-01-26 13:58:30 -07:00
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Eric Schulte 458824493d Revert "tangled files should not be writable"
This reverts commit 5e3b8259c7.
2012-12-15 15:14:01 -07:00
Eric Schulte 2c34715ae6 option to byte-compile elisp loaded from Org files
* lisp/ob-tangle.el (org-babel-load-file): When called with a prefix
  argument the tangled emacs-lisp file will be byte compiled.
2012-12-12 10:48:57 -07:00
Eric Schulte 5e3b8259c7 tangled files should not be writable
Hopefully this will help keep people from editing tangled source files
  by accident.

* lisp/ob-tangle.el (org-babel-tangle): Tangled files should not be
  writable.
2012-12-12 10:48:57 -07:00
Eric Schulte ff0081847c requiring ob now pulls in all of Babel 2012-12-12 10:48:56 -07:00
Bastien Guerry 5c762bbdc6 Remove some autoloads and clean up code.
* org.el (turn-on-orgtbl): Moved here from org-table.el.
(org-clock-persistence-insinuate): Moved here from org-clock.el.
(org-update-all-dblocks, org-map-entries)
(org-require-autoloaded-modules, org-forward-element)
(org-backward-element, org-up-element)
(org-element-greater-elements, org-drag-element-backward)
(org-drag-element-forward, org-mark-element)
(org-narrow-to-element, org-transpose-element)
(org-unindent-buffer): Don't autoload.

* org-clock.el (org-clock-get-clocktable): Rename from
`org-get-clocktable'.
(org-clock-persistence-insinuate): Move to org.el.

* org-capture.el: Do no set `generated-autoload-file' locally.
Minor code clean up.

* org-agenda.el (org-agenda-list): Use
`org-clock-get-clocktable'.  Do no set
`generated-autoload-file' locally.

* org-table.el (org-table-iterate-buffer-tables): Minor
reformatting.
(turn-on-orgtbl): Move to org.el.

* org-html.el (org-export-htmlize-generate-css): Don't autoload.

* org-timer.el (org-timer-pause-or-continue, org-timer-stop):
Ditto.

* ob-tangle.el (org-babel-tangle-lang-exts): Ditto.

* ob-lob.el (org-babel-lob-ingest): Ditto.

* org-id.el (org-id-copy)
(org-id-get-with-outline-path-completion)
(org-id-get-with-outline-drilling): Ditto.

* org-lparse.el (org-lparse-and-open, org-lparse-batch)
(org-lparse-to-buffer, org-replace-region-by)
(org-lparse-region): Ditto.

* org-mobile.el (org-mobile-create-sumo-agenda): Ditto.
2012-10-02 10:03:15 +02:00
Bastien Guerry e4c31cf98b Use generated-autoload-file: "org-loaddefs.el" as a local variable. 2012-10-02 08:50:46 +02:00
Michael Brand 9852ad9418 ob-tangle: Fix bug when heading has no text
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use dummy
string when heading has no text.
2012-09-02 10:30:40 +02:00
Bastien Guerry 9afc2ac56b ob-*.el: Use ̀org-no-properties' instead of `org-babel-clean-text-properties'
* ob.el (org-babel-get-src-block-info)
(org-babel-check-src-block, org-babel-current-result-hash)
(org-babel-parse-src-block-match, org-babel-read-link)
(org-babel-insert-result, org-babel-clean-text-properties):
Use ̀org-no-properties' instead of
`org-babel-clean-text-properties'.
(org-babel-clean-text-properties): Delete redundant function
`org-babel-clean-text-properties'.

* ob-tangle.el (org-babel-tangle-collect-blocks)
(org-babel-tangle-comment-links): Ditto.

* ob-table.el (sbe): Ditto.

* ob-lob.el (org-babel-lob-get-info)
(org-babel-lob-execute): Ditto.

* ob-exp.el (org-babel-exp-non-block-elements): Ditto.
2012-08-15 09:39:24 +02:00
Bastien Guerry 09743f48d6 Fix many small typos. 2012-08-13 05:59:44 +02:00
Bastien Guerry 1edf05f14c ob-tangle.el: Don't use `org-flet'
* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string):
Don't use `org-flet'.
2012-08-10 15:40:00 +02:00
Bastien Guerry 9156bc2d64 Various minor fixes.
* org-pcomplete.el (org-compat): Require.

* ob-tangle.el (org-babel-load-file): Don't use `org-flet'.

* org-bibtex.el (org-bibtex-write): Use let*.
2012-08-10 15:32:24 +02:00
Eric Schulte 1952afa6ed more efficient org-babel-with-temp-filebuffer
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): Don't execute
  macro argument multiple times.
2012-08-03 13:34:10 -06:00
Eric Schulte 63b5f8f2e8 replace flet/labels with org-flet/org-labels
This patch ensure Org-mode will build on all supported versions of
Emacs, after the renaming of the cl macros behind the cl- prefix in the
recent Emacs trunk.

* lisp/org-compat.el (org-flet): Compatibility function now that flet
  has been removed from cl-macs.
  (org-labels): Compatibility function now that labels has been removed
  from cl-macs.
* lisp/ob-R.el (org-compat): Require org-compat.
* lisp/ob-comint.el: Require org-compat.
* lisp/ob-exp.el (org-babel-exp-do-export): Switch to compatibility
  function.
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to
  compatibility function.
* lisp/ob-lob.el (org-babel-lob-get-info): Switch to compatibility
  function.
  (org-babel-lob-execute): Switch to compatibility function.
* lisp/ob-python.el (org-babel-python-evaluate-session): Switch to
  compatibility function.
* lisp/ob-ref.el (org-babel-ref-index-list): Switch to compatibility
  function.
* lisp/ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility
  function.
* lisp/ob-tangle.el (org-babel-load-file): Switch to compatibility
  function.
  (org-babel-tangle): Switch to compatibility function.
  (org-babel-spec-to-string): Switch to compatibility function.
* lisp/ob.el (org-babel-view-src-block-info): Switch to compatibility
  function.
  (org-babel-execute-src-block): Switch to compatibility function.
  (org-babel-edit-distance): Switch to compatibility function.
  (org-babel-switch-to-session-with-code): Switch to compatibility
  function.
  (org-babel-sha1-hash): Switch to compatibility function.
  (org-babel-balanced-split): Switch to compatibility function.
  (org-babel-join-splits-near-ch): Switch to compatibility function.
  (org-babel-get-rownames): Switch to compatibility function.
  (org-babel-format-result): Switch to compatibility function.
  (org-babel-insert-result): Switch to compatibility function.
  (org-babel-examplize-region): Switch to compatibility function.
  (org-babel-merge-params): Switch to compatibility function.
  (org-babel-noweb-p): Switch to compatibility function.
  (org-babel-expand-noweb-references): Switch to compatibility function.
* lisp/org-bibtex.el (org-bibtex-headline): Switch to compatibility
  function.
  (org-bibtex-fleshout): Switch to compatibility function.
  (org-bibtex-read): Switch to compatibility function.
  (org-bibtex-write): Switch to compatibility function.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Switch to
  compatibility function.
* lisp/org-exp.el (org-export-format-source-code-or-example): Switch to
  compatibility function.
* lisp/org-macs.el (org-called-interactively-p): Indentation fix.
* lisp/org-mouse.el (org-mouse-timestamp-today): Switch to compatibility
  function.
  (org-mouse-set-priority): Switch to compatibility function.
  (org-mouse-popup-global-menu): Switch to compatibility function.
  (org-mouse-context-menu): Switch to compatibility function.
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data): Switch to
  compatibility function.
  (org-plot/gnuplot-script): Switch to compatibility function.
* lisp/org.el (org-entry-get): Switch to compatibility function.
  (org-fill-paragraph): Switch to compatibility function.
  (org-auto-fill-function): Switch to compatibility function.
2012-07-25 09:23:57 -06:00
Bastien Guerry ecd0562c5f Fix the master branch.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.

This commit also bumps the version number to 7.8.06.

The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
2012-03-19 22:01:29 +01:00
Bastien Guerry 6e306f65ff Fix copyright years in maint. 2012-03-17 16:31:04 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry 73bb18ba37 Manually revert to the Release 7.8.04 tag. 2012-03-17 15:52:24 +01:00
Bastien Guerry 38c5045725 Fix copyright years. 2012-03-17 14:36:25 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00
Eric Schulte 1a42967061 Merge branch 'origin-maint' 2012-03-09 06:54:36 -07:00
Deech 26e817ac20 The link generated by org-store-link is escaped twice when tangling with ":comments yes" flag.
* ob-tangle.el (org-babel-spec-to-string): The link generated by
  org-store-link is escaped twice when tangling with ":comments yes"
  flag.
2012-03-09 06:54:22 -07:00
Bastien Guerry 0630d89a0c Merge branch 'maint' of orgmode.org:org-mode 2012-03-05 21:10:22 +01:00
Eric Schulte efe039db93 fix two bugs related to calling tangle with a prefix argument
* lisp/ob-tangle.el (org-babel-tangle): Don't prompt for a file name
  if :tangle is specified.
* lisp/ob.el (org-babel-expand-noweb-references): Widen buffer when
  expanding noweb references.
2012-03-05 08:22:35 -07:00
Bastien Guerry 04971de4b9 Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1)
* org-exp.el (org-export-kill-product-buffer-when-displayed)
(org-export-initial-scope, org-export-date-timestamp-format)
(org-export-with-tasks, org-export-email-info)
(org-export-table-remove-empty-lines): Add version tag.

* org-mobile.el (org-mobile-files-exclude-regexp)
(org-mobile-use-encryption, org-mobile-encryption-tempfile)
(org-mobile-encryption-password, org-mobile-agendas): Add
version tag.

* ob-plantuml.el (org-plantuml-jar-path): Add version tag.

* org.el (org-babel-load-languages, org-clone-delete-id)
(org-log-buffer-setup-hook)
(org-loop-over-headlines-in-active-region)
(org-use-sub-superscripts, org-startup-with-beamer-mode)
(org-startup-with-inline-images, org-ctrl-k-protect-subtree)
(org-catch-invisible-edits)
(org-link-search-must-match-exact-headline)
(org-confirm-shell-link-not-regexp)
(org-confirm-elisp-link-not-regexp, org-log-refile)
(org-refile-use-cache)
(org-refile-active-region-within-subtree)
(org-todo-repeat-to-state, org-get-priority-function)
(org-agenda-jump-prefer-future)
(org-read-date-force-compatible-dates)
(org-use-effective-time)
(org-complete-tags-always-offer-all-agenda-tags)
(org-properties-postprocess-alist)
(org-format-latex-signal-error)
(org-latex-to-mathml-jar-file)
(org-latex-to-mathml-convert-command)
(org-export-latex-default-packages-alist)
(org-hidden-keywords, org-pretty-entities)
(org-pretty-entities-include-sub-superscripts)
(org-src-fontify-natively, org-effort-durations)
(org-speed-command-hook): Add version tag.

* org-html.el (org-export-html-footnote-separator)
(org-export-html-mathjax-options)
(org-export-html-mathjax-template)
(org-export-html-headline-anchor-format)
(org-export-html-preamble-format)
(org-export-html-postamble-format)
(org-export-html-table-align-individual-fields)
(org-export-html-protect-char-alist, org-export-html-divs):
Add version tag.

* org-ctags.el (org-ctags-path-to-ctags)
(org-ctags-open-link-functions)
(org-ctags-new-topic-template): Add version tag.

* ob-exp.el (org-export-babel-evaluate): Add version tag.

* org-beamer.el (org-beamer-use-parts)
(org-beamer-frame-level, org-beamer-frame-default-options)
(org-beamer-column-view-format, org-beamer-themes)
(org-beamer-environments-extra, org-beamer-fragile-re)
(org-beamer-outline-frame-title)
(org-beamer-outline-frame-options): Add version tag.

* org-wl.el (org-wl-link-remove-filter)
(org-wl-shimbun-prefer-web-links)
(org-wl-nntp-prefer-web-links, org-wl-disable-folder-check)
(org-wl-namazu-default-index): Add version tag.

* org-clock.el (org-task-overrun-text)
(org-clocktable-defaults, org-clock-clocktable-formatter)
(org-clock-clocktable-language-setup)
(org-clock-report-include-clocking-task)
(org-clock-resolve-expert): Add version tag.

* ob-lob.el (org-babel-lob-files): Add version tag.

* org-freemind.el (org-freemind-node-css-style): Add version
tag.

* org-archive.el (org-archive-reversed-order)
(org-archive-subtree-add-inherited-tags): Add version tag.

* org-bibtex.el (org-bibtex-autogen-keys, org-bibtex-prefix)
(org-bibtex-treat-headline-as-title)
(org-bibtex-export-arbitrary-fields)
(org-bibtex-key-property, org-bibtex-tags)
(org-bibtex-tags-are-keywords, org-bibtex-no-export-tags)
(org-bibtex-type-property-name): Add version tag.

* org-timer.el (org-timer-default-timer): Add version tag.

* org-taskjuggler.el (org-export-taskjuggler-extension)
(org-export-taskjuggler-project-tag)
(org-export-taskjuggler-resource-tag)
(org-export-taskjuggler-target-version)
(org-export-taskjuggler-default-project-version)
(org-export-taskjuggler-default-project-duration)
(org-export-taskjuggler-default-reports)
(org-export-taskjuggler-default-global-properties): Add
version tag.

* org-habit.el (org-habit-today-glyph)
(org-habit-completed-glyph): Add version tag.

* org-list.el (org-alphabetical-lists)
(org-list-ending-method, org-list-end-regexp)
(org-list-automatic-rules, org-list-use-circular-motion)
(org-list-indent-offset): Add version tag.

* ob-picolisp.el (org-babel-picolisp-cmd): Add version tag.

* org-icalendar.el (org-icalendar-alarm-time)
(org-icalendar-combined-description)
(org-icalendar-honor-noexport-tag)
(org-icalendar-date-time-format): Add version tag.

* org-src.el (org-src-tab-acts-natively): Add version tag.

* org-exp-blocks.el (org-export-blocks-postblock-hook): Add
version tag.

* org-table.el (org-table-exit-follow-field-mode-when-leaving-table)
(org-table-fix-formulas-confirm)
(org-table-duration-custom-format)
(org-table-formula-field-format): Add version tag.

* org-publish.el (org-publish-sitemap-sort-files)
(org-publish-sitemap-sort-folders)
(org-publish-sitemap-sort-ignore-case)
(org-publish-sitemap-date-format)
(org-publish-sitemap-file-entry-format): Add version tag.

* ob-js.el (org-babel-js-cmd): Add version tag.

* org-docbook.el (org-export-docbook-footnote-separator)
(org-export-docbook-xslt-stylesheet): Add version tag.

* org-entities.el (org-entities-ascii-explanatory)
(org-entities-user): Add version tag.

* ob.el (org-confirm-babel-evaluate)
(org-babel-no-eval-on-ctrl-c-ctrl-c): Add version tag.

* ob-tangle.el (org-babel-tangle-lang-exts)
(org-babel-post-tangle-hook, org-babel-pre-tangle-hook)
(org-babel-tangle-body-hook)
(org-babel-tangle-comment-format-beg)
(org-babel-tangle-comment-format-end)
(org-babel-process-comment-text): Add version tag.

* org-gnus.el (org-gnus-nnimap-query-article-no-from-file):
Add version tag.

* org-crypt.el (org-crypt-disable-auto-save): Add version tag.

* org-inlinetask.el (org-inlinetask-default-state): Add
version tag.

* ob-scheme.el (org-babel-scheme-cmd): Add version tag.

* ob-lisp.el (org-babel-lisp-dir-fmt): Add version tag.

* org-attach.el (org-attach-store-link-p): Add version tag.

* org-capture.el (org-capture-templates)
(org-capture-before-finalize-hook)
(org-capture-after-finalize-hook): Add version tag.

* org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled)
(org-agenda-time-leading-zero, org-agenda-follow-indirect)
(org-agenda-menu-two-column, org-agenda-menu-show-matcher)
(org-agenda-timegrid-use-ampm)
(org-agenda-remove-timeranges-from-blocks)
(org-agenda-inactive-leader, org-agenda-current-time-string)
(org-agenda-show-current-time-in-grid)
(org-agenda-search-view-force-full-words)
(org-agenda-search-view-always-boolean)
(org-agenda-clock-consistency-checks)
(org-agenda-include-deadlines)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-day-face-function)
(org-agenda-category-icon-alist)
(org-agenda-bulk-custom-functions)
(org-agenda-insert-diary-extract-time): Add version tag.

* org-latex.el (org-export-latex-inputenc-alist)
(org-export-latex-tag-markup)
(org-export-latex-timestamp-inactive-markup)
(org-export-latex-href-format)
(org-export-latex-hyperref-format)
(org-export-latex-footnote-separator)
(org-export-latex-quotes)
(org-export-latex-table-caption-above)
(org-export-latex-listings-w-names)
(org-export-latex-minted-langs)
(org-export-latex-listings-options)
(org-export-latex-minted-options)
(org-latex-default-figure-position, org-export-pdf-logfiles):
Add version tag.

* org-faces.el (org-faces-easy-properties)
(org-fontify-quote-and-verse-blocks, org-cycle-level-faces):
Add version tag.

* ob-ditaa.el (org-ditaa-jar-option): Add version tag.

Thanks to Glenn Morris for reporting this.
2012-02-13 15:49:28 +01:00
Eric Schulte 4b59c36b03 adding default argument to org-babel-noweb-wrap
This makes it easier to keep consistent behavior.

* lisp/ob-tangle.el (org-babel-tangle-clean): Just use default value.
* lisp/ob.el (org-babel-noweb-wrap): Add default value.
  (org-babel-expand-noweb-references): Just use default value.
2012-02-01 08:19:29 -07:00
Eric Schulte 3d25553588 allow customization of the noweb reference syntax
Thanks to Sean O'Halpin for suggesting this change.

* lisp/ob-tangle.el (org-babel-tangle-clean): Use the customizable
  noweb wrappers.
* lisp/ob.el (org-babel-noweb-wrap-start): Begin a noweb reference.
  (org-babel-noweb-wrap-end): End a noweb reference.
  (org-babel-noweb-wrap): Apply the customizable noweb wrappers.
  (org-babel-expand-noweb-references): Use the customizable noweb
  wrappers.
2012-01-27 16:04:09 -07:00
Eric Schulte abf3060e47 new "no-export" option to :noweb header argument, and consolidated noweb logic
* lisp/ob-exp.el (org-babel-exp-src-block): Use `org-babel-noweb-p'.
  (org-babel-exp-inline-src-blocks): Use `org-babel-noweb-p'.
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use
  `org-babel-noweb-p'.
* lisp/ob.el (org-babel-execute-src-block): Use `org-babel-noweb-p'.
  (org-babel-expand-src-block): Use `org-babel-noweb-p'.
  (org-babel-load-in-session): Use `org-babel-noweb-p'.
  (org-babel-merge-params): Use `org-babel-noweb-p'.
  (org-babel-noweb-p): New function used to determine if noweb
  expansion should be carried out in a given context.
2012-01-11 10:15:20 -07:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Eric Schulte 647849dff9 better delimiting of Org-mode text preceding a code block
Thanks to Christopher Genovese for this change

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Better
  delimiting of Org-mode text preceding a code block.
2011-09-16 09:52:34 -06:00
Eric Schulte b9922ba879 customizable processing of Org-mode text used as comments in tangled source-code files
* lisp/ob-tangle.el (org-babel-process-comment-text): Customizable
  function to process comment text.
  (org-babel-tangle-collect-blocks): Make use of new customizable
  processing function.
  (org-babel-spec-to-string): Call customizable function rather than
  `org-babel-trim'.
2011-09-16 09:52:34 -06:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
David Maus 545bfddeea Provide edebug specifications for macros
* org-macs.el (org-with-gensyms, org-called-interactively-p)
(with-silent-modifications, org-bound-and-true-p)
(org-unmodified, org-re, org-preserve-lc)
(org-without-partial-completion, org-with-point-at)
(org-no-warnings, org-if-unprotected, org-if-unprotected-1)
(org-if-unprotected-at, org-with-remote-undo)
(org-no-read-only, org-save-outline-visibility)
(org-with-wide-buffer, org-with-limited-levels)
(org-eval-in-environment): Provide edebug specifications.
* org-src.el (org-src-do-at-code-block): Dto.
* org-publish.el (org-publish-with-aux-preprocess-maybe): Dto.
* org-compat.el (org-xemacs-without-invisibility): Dto.
* org-clock.el (org-with-clock-position, org-with-clock): Dto.
* org-agenda.el (org-agenda-with-point-at-orig-entry)
(org-batch-agenda, org-batch-agenda-csv)
(org-batch-store-agenda-views): Dto.
* ob.el (org-babel-do-in-edit-buffer)
(org-babel-map-src-blocks, org-babel-map-inline-src-blocks): Dto.
* ob-tangle.el (org-babel-with-temp-filebuffer): Dto.
* ob-table.el (sbe): Dto.
* ob-exp.el (org-babel-exp-in-export-file): Dto.
* ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Dto.
2011-08-12 08:38:59 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Deech 5a5036cc13 Ignore errors when launching a language's mode when tangling a source block.
The lua-mode for instance was throwing errors that killed the tangling process.

* lisp/ob-tangle.el (org-babel-tangle): Ignore errors thrown by
  language modes.
2011-07-04 15:00:17 -06:00
Eric Schulte e4204fc3fe tangle: ob-tangle now tangles only the current block when called with a prefix argument
* lisp/ob-tangle.el (org-babel-tangle-file): Use the new argument list
  to org-babel-tangle.
  (org-babel-tangle): Now when called with a prefix argument, only the
  current code block is tangled.
2011-06-17 16:41:50 -07:00
Eric Schulte 23e7adbdaa Revert "ob-tangle: initial implementation of named code block combination"
This reverts commit 0e4f9da82e.
2011-06-15 20:18:33 -07:00
Eric Schulte e001901234 revert "ob-tangle: more sophisticated block combination during tangling" 2011-06-15 20:18:22 -07:00
Eric Schulte 39cd07aacf Revert "ob-tangle: no longer inserting newlines between appended code blocks"
This reverts commit 90f6765cdf.
2011-06-15 20:14:31 -07:00
Eric Schulte 95f9aa5ff5 fixing compiler warnings for Babel functions
* lisp/ob-R.el (ess-local-process-name): This variable wasn't known to
  be defined.
* lisp/ob-lisp.el (org-babel-lisp-dir-fmt): This defcustom now has a
  group specified.
* lisp/ob-tangle.el (org-bracket-link-regexp): This variable wasn't
  known to be defined.
  (org-babel-tangle-combine-named-blocks): Roll my own version of a
  forbidden common lisp function.
* lisp/ob.el (org-babel-sha1-hash): Using a non-deprecated version of
  called-interactively.
2011-06-14 11:23:56 -07:00
Eric Schulte 90f6765cdf ob-tangle: no longer inserting newlines between appended code blocks
* lisp/ob-tangle.el (org-babel-tangle-combine-named-blocks): No longer
  inserting newlines between appended code blocks.
2011-06-13 14:58:56 -07:00
Eric Schulte 64c1304473 ob-tangle: more sophisticated block combination during tangling
Thanks to Neeum Zawan for suggesting this behavior

* lisp/ob-tangle.el (org-babel-tangle-named-block-combination): Block
  combination can now take a number of values.
  (org-babel-tangle-combine-named-blocks): More sophisticated block
  combination behavior.
2011-06-10 12:55:13 -06:00
Eric Schulte 0e4f9da82e ob-tangle: initial implementation of named code block combination
* lisp/ob-tangle.el (org-babel-tangle-do-combine-named-blocks):
  Switch to turn on the combination of code blocks of the same name.
  (org-babel-tangle-combine-named-blocks): Combine blocks of the same
  name.
2011-06-10 12:29:10 -06:00
Shaun Johnson de63411264 Babel: Stop tangling failing in an indirect buffer
* ob-tangle.el (org-babel-tangle): Make it work in an indirect buffer.

The problem was that the message generated after tangling included the
file name of the current buffer which was nil in an indirect buffer.

TINYCHANGE
2011-04-15 09:55:22 -06:00
Eric Schulte cd4ce49449 ob-tangle: fix link extraction for newer version of org-store-link
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Brought the
  link extraction code into line with a newer version of the
  org-store-link function.
2011-04-01 10:34:49 -06:00
Eric Schulte 814012ca80 ob-tangle: don't call `org-store-link' interactively when tangling
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Don't call
  `org-store-link' interactively as it can confuse the setting of
  `org-link-to-org-use-id' and cause undue edits to the org-mode
  buffer during tangling.
2011-03-16 07:45:27 -06:00
Eric Schulte d0a4ed53f1 ob: new header argument `padline' controls newline padding around tangled code
* lisp/ob-tangle.el (org-babel-spec-to-string): Check value of padline
  on tangling, no longer use the now-removed variable
  `org-babel-tangle-pad-newline'.
* lisp/ob.el (org-babel-header-arg-names): Add padline to the list of
  header argument names.
  (org-babel-default-header-args): Set the default value of padline to
  "yes".
  (org-babel-merge-params): Cleaned up the merge logic, added padline.
* doc/org.texi (padline): Documentation of the new padline header
  argument.
2011-03-15 11:16:09 -06:00
Eric Schulte a793b77625 ob-tangle: new hook for pre-processing code block bodies on tangling
* lisp/ob-tangle.el (org-babel-tangle-body-hook): Hook for changing
  the contents of a code block body on export.
  (org-babel-tangle-collect-blocks): Apply
  `org-babel-tangle-body-hook' to the collected bodies of code blocks.
2011-03-14 09:31:33 -06:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Eric Schulte c07b5aed1e ob-tangle: new :mkdirp header argument creates parent dirs of tangle targets
* lisp/ob-tangle.el (org-babel-tangle): New :mkdirp header argument
  optionally creates parent directories of tangle targets.
2011-01-19 20:29:09 -07:00
Eric Schulte eb3bf55d48 ob: new ":comments noweb" option for wrapping noweb references in comment links
* lisp/ob-tangle.el (org-babel-spec-to-string): Adding "noweb" as a
  linking comment type
  (org-babel-tangle-comment-links): Returns comment links for the
  source code block at point

* lisp/ob.el (org-babel-expand-noweb-references): When :comments is
  set to "noweb" then wrap noweb references in comment links.
2011-01-16 08:21:16 -07:00
Eric Schulte c8e5ba90cc ob: ob-jump-to-org is more robust to link comment impostors
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Ever wider
  searches until either a matching block is found, or the limits of
  the file are reached.
2011-01-13 14:07:19 -07:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Eric Schulte 4fca6b54b5 org-babel-load-file can now be called interactively
* lisp/ob-tangle.el (org-babel-load-file): Can be called interactively.
2010-11-17 13:04:48 -07:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Eric Schulte 2152f1ec28 ob-tangle: detangle changes in code files back to the original org files
* lisp/ob-tangle.el (org-babel-update-block-body): declaring function
  for updating code block bodies
  (org-babel-spec-to-string):
  (org-babel-detangle): detangle all tangled and commented code blocks
  in the current file back to org
  (org-babel-tangle-jump-to-org): jump from a tangled and commented
  file back to the originating org-mode code block
ob-tangle: detangle changes in code files back to the original org files

* lisp/ob-tangle.el (org-babel-update-block-body): declaring function
  for updating code block bodies
  (org-babel-spec-to-string):
  (org-babel-detangle): detangle all tangled and commented code blocks
  in the current file back to org
  (org-babel-tangle-jump-to-org): jump from a tangled and commented
  file back to the originating org-mode code block
2010-10-29 02:13:38 -06:00
Eric Schulte 93600e41a6 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-10-29 02:10:18 -06:00
Eric Schulte c6565eaa43 fixed typos in tangle comment link format strings
* lisp/ob-tangle.el (org-babel-tangle-comment-format-beg): fix typo
  (org-babel-tangle-comment-format-end): fix typo
2010-10-29 01:37:28 -06:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Eric Schulte 65217b7fb4 tangle: ensure that full info (with expanded variables) for tangling blocks 2010-10-21 07:00:39 -06:00