Commit Graph

269 Commits

Author SHA1 Message Date
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
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Eric Schulte a503e031fb ob-tangle: fixed bug, org-babel-post-tangle-hook was using an undefined macro
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): a macro for
  quickly visiting files with cleanup

  (org-babel-tangle): now using the locally defined
  with-temp-filebuffer macro
2010-07-16 15:56:17 -07:00
Tom Dye 272aefce83 Finished editing Babel docstrings 2010-07-13 16:20:08 -07:00
Eric Schulte e3aaaec91c babel: more informative automatically generated block names in tangled comments
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): more
  informative automatically generated block names in comments
2010-07-12 17:07:23 -07:00
Eric Schulte 433b374c10 babel: enhanced code block movement functions
Thanks to Austin Frank for suggesting these features and to Jonathan
  Arkell for an implementation suggestion

This commit
 - adds `org-babel-goto-named-result' for jumping to named results
 - adds TAB-completion to `org-babel-goto-named-src-block'
 - standardizes on "-src-" instead of "-source-" in all babel functions
 - adds `org-babel-[next/previous]-src-block' functions and keybindings
 - documents the above in orgcard.tex

* doc/orgcard.tex: update documentation of babel keybindings

* lisp/ob-exp.el (org-exp-res/src-name-cleanup): standardized on
  "-src-" instead of "-source-"

* lisp/ob-keys.el (org-babel-key-bindings): updating keybindings for
  new movement functions

* lisp/ob-lob.el (org-babel-lob-ingest): standardized on "-src-"
  instead of "-source-"

* lisp/ob-ref.el (org-babel-ref-resolve-reference): standardized on
  "-src-" instead of "-source-"

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): standardized on
  "-src-" instead of "-source-"

* lisp/ob.el (org-babel-src-name-regexp): standardized on "-src-"
  instead of "-source-"

  (org-babel-src-name-w-name-regexp): adding regexp for matching
  source names along with their names

  (org-babel-get-src-block-info): using new named source block regexp

  (org-babel-result-regexp): adding optional whitespace after result
  regexp

  (org-babel-result-w-name-regexp): adding regexp for matching results
  which have names

  (org-babel-named-src-block-regexp-for-name): standardized on "-src-"
  instead of "-source-"

  (org-babel-map-src-blocks): standardized on "-src-" instead of
  "-source-"

  (org-babel-where-is-src-block-head): standardized on "-src-" instead of
  "-source-"

  (org-babel-goto-named-src-block): standardized on "-src-" instead of
  "-source-", also added completing read

  (org-babel-src-block-names): collects source block names from a file
  or the current buffer

  (org-babel-goto-named-result): function for jumping to a named
  result

  (org-babel-result-names): returns results names from a file or the
  current buffer

  (org-babel-next-src-block): jump to the next source block

  (org-babel-previous-src-block): jump to the previous source block
2010-07-11 21:37:24 -07:00
Eric Schulte 0f5a2fb075 ob-tangle: fixed recently introduced issue with org-babel-load-file
* lisp/ob-tangle.el (org-babel-tangle): applying optional target-file
  argument through integration into the default header arguments
  (allowing overwriting through standard header-argument merging), and
  allowing a default setting of (:tangle . "no") to be overwritten
  when a target-file is specified.
2010-07-09 09:43:30 -07:00
Eric Schulte b44ecb51a4 ob-tangle: fixed `declare-function' call to point to correct file or origin
* lisp/ob-tangle.el (with-temp-filebuffer): fixed `declare-function'
  call to point to correct file or origin
2010-07-09 08:46:56 -07:00
Eric Schulte 07b34e7a6b babel: declaring function to inhibit compiler warning
* lisp/ob-tangle.el (with-temp-filebuffer): declaring function to
  inhibit compiler warning
2010-07-08 13:40:08 -07:00
Eric Schulte abcb76891b org-babel-post-tangle-hook run in code files tangled by `org-babel-tangle'
* lisp/ob-tangle.el (org-babel-post-tangle-hook): adding hook which
  can be used to call functions from inside of code files tangled by
  org-babel-tangle

  (org-babel-tangle): added call to org-babel-post-tangle-hook
2010-07-08 11:58:20 -07:00
Eric Schulte 0deb72c068 babel: removed `org-babel-tangle-w-comments', now just use the :comments header arg
* lisp/ob-tangle.el (org-babel-spec-to-string): removed
  `org-babel-tangle-w-comments', now just use the :comments header arg
  to control the insertion of comments on tangling
2010-07-05 11:14:51 -07:00
Eric Schulte d7b7025eac flattening out lisp directory structure
all babel and babel/langs files now live in the base of the lisp directory.
2010-07-05 11:14:49 -07:00
Renamed from lisp/babel/ob-tangle.el (Browse further)