Commit Graph

261 Commits

Author SHA1 Message Date
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
Dan Davison 35b0d6b1d4 babel: Fix bug in `org-babel-tangle-collect-blocks'
* ob-tangle.el (org-babel-tangle-collect-blocks): Fix
    bug (reference to unassigned variable `src-lang' and avoid
    calling org-babel-get-src-block-info twice
2010-10-21 13:06:56 +01:00
Eric Schulte 5bdc043919 careful not to needlessly execute blocks during tangling
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): now explicitly
  checks that a code block will actually be tangled before collecting
  it's full information (a process which could involve the execution
  of other code blocks)
2010-10-21 13:06:55 +01:00
Eric Schulte 24cde316a1 beefing up the docs of the org-babel-tangle-comment-format-* variables 2010-10-21 13:06:55 +01:00
Dan Davison a6720e38a3 babel: tangle: Respond to changes in generic expansion function
* ob-tangle.el (org-babel-tangle-collect-blocks): Supply
	variable assignment lines to generic expansion command
2010-10-21 13:06:01 +01:00
Eric Schulte d32c8d49e5 ob-tangle: only create links for blocks that will actually tangle
this commit includes a unit test

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): only create
  links for blocks that will actually tangle
2010-10-14 17:15:11 -06:00
Dan Davison 4eaa52caca babel: alter whitespace to fit into 80 columns
* ob-tangle.el (org-babel-spec-to-string): whitespace changes

	* ob-python.el (org-babel-expand-body:python): whitespace changes
2010-10-12 15:50:00 +01:00
Dan Davison deb391f128 babel: Don't trim whitespace when `org-src-preserve-indentation' is non-nil
* ob-tangle.el (org-babel-spec-to-string): Don't trim
	whitespace when `org-src-preserve-indentation' is non-nil

	* ob-python.el (org-babel-expand-body:python): Don't trim
	whitespace when `org-src-preserve-indentation' is non-nil

Based on report and patches by Antti Kaihola.
2010-10-12 15:47:59 +01:00
Eric Schulte f687f51dd0 ob-exp: ":noweb tangle" now expands noweb references during tangling
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): accepting
  "tangle" as a positive argument for the :noweb header argument
  during tangling
2010-10-06 10:37:46 -06:00
Eric Schulte c4916bb743 now sharing the file name in the tangling message
* lisp/ob-tangle.el (org-babel-tangle): now sharing the file name in
  the tangling message
2010-09-30 23:24:02 -06:00
Eric Schulte 207390dfa8 autoload org-babel-tangle-lang-exts from ob-tangle
* lisp/ob-tangle.el: autoload org-babel-tangle-lang-exts from ob-tangle
2010-09-08 11:33:24 -06:00
Eric Schulte 07250ec74a tangle: rename `lang' variable to `language' so it is not overridden
- this is required due to recent changes to org-babel-map-src-blocks
- thanks to Dan for pointing this out

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): rename `lang'
  to `language'
2010-09-05 19:29:28 -06:00
Eric Schulte ee801fd88c ob-tangle: customizable link formats in tangled comments
* lisp/ob-tangle.el (org-babel-tangle-comment-format-beg): format
  string specifying the link-comment preceding a code block
  (org-babel-tangle-comment-format-end): format string specifying the
  link-comment following a code block
  (org-babel-tangle-collect-blocks): storing more information in the
  spec of a tangling code block
  (org-babel-spec-to-string): now makes use of customizable
  link-comment formats
2010-09-05 15:15:11 -06:00
Eric Schulte c881fa0760 ob-tangle: :comments header argument can now tangle surrounding text
This commit introduces a new set of :comments header arguments
- no :: retains its behavior of not tangling any comments
- yes :: retains its behavior of wrapping the code in links back to
         the original org-mode file
- link :: is synonymous with "yes"
- org :: does not wrap the code in links back to the original org
         file, but does include preceding text from the org-mode
         file as a comment before the code block
- both :: turns on both the "link" and "org" options

* lisp/ob-tangle.el (org-babel-tangle-pad-newline): can be used to
  control the amount of extra newlines inserted into tangled code
  (org-babel-tangle-collect-blocks): now conditionally collects
  information to be used for "org" style comments
  (org-babel-spec-to-string): now inserts "org" style comments, and
  obeys the newline configuration variable when inserting whitespace
* doc/org.texi (comments): documenting the new :comments header
  arguments
2010-09-04 08:45:45 -06:00
Eric Schulte 48114acd2a ob-tangle: adding pre-tangle hook for customization of tangle preparation
* lisp/ob-tangle.el (org-babel-pre-tangle-hook): defines new tangle
  hook
  (org-babel-tangle): calls new tangle hook
2010-09-03 07:55:59 -06:00
Aidan Kehoe 9afcc02588 Use integer syntax for the MODE argument to #'set-file-modes
Hello!

We need this change to get org-mode compiling with recent XEmacs 21.5. On
previous 21.5 and current 21.4, the problem manifests itself at runtime, not
compile time, like so:

  (set-file-modes "/tmp/aidan/foo.el" ?\755)
  => Wrong type argument: integerp, ?í

One old reason to go for the ?\755 syntax instead of the #o755 syntax under
GNU Emacs was to be that older versions of GNU Emacs didn’t support #o755,
but, to my knowledge, every released GNU Emacs since March 2000 has
supported the latter syntax.

Best,

Aidan Kehoe, the XEmacs project.

ChangeLog addition:

2010-08-21  Aidan Kehoe  <kehoea@parhasard.net>

	* ob-tangle.el (org-babel-tangle): Change the MODE argument to
	#'set-file-modes to use integer, not character syntax, avoiding
	compile problems with recent XEmacs.
2010-08-23 12:00:01 +02:00
Eric Schulte 158f5cc726 ob-tangle: don't throw errors when we're not under of a headline
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): don't throw
  errors when we're not under of a headline
2010-08-04 09:20:58 -06:00
John Wiegley dfa41442af Resolve a compiler warning 2010-07-28 20:50:19 -04:00
Eric Schulte f6ccee2568 ob-tangle: org-babel-post-tangle-hook no longer kills the current buffer
* lisp/ob-tangle.el (org-babel-find-file-noselect-refresh): finds a
  file ensuing that the latest changes on disk are represented

  (org-babel-with-temp-filebuffer): now only kills the buffer of the
  tangled file, and doesn't kill said buffer if the file is already
  being visited
2010-07-28 07:41:16 -06:00
Eric Schulte e3429de115 ob-tangle: inhibit unwanted buffer movement on use of post-tangle-hook
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): use
  find-file-noselect to avoid excess buffer movement
2010-07-21 09:46:55 -07:00