* 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.
* 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.
* 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.
* 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.
* 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.
* 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).
* 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.
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
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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."
* 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.
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.
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.
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.
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.
* 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.
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.
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.
* 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.
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.
* 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'.
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
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.
* 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.
* 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.
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.
* 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.
* 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
* 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.
* 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.
* 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.
* 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.
* 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
* 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)
* 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.
- 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'
* 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
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
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.
* 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
* 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
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
* 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.
* 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
* 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