Merge branch 'maint'

This commit is contained in:
Bastien Guerry 2013-11-04 12:20:20 +01:00
commit 2ac57db0a3
2 changed files with 11 additions and 8 deletions

View File

@ -150,16 +150,18 @@ evaluating BODY."
Source code blocks are extracted with `org-babel-tangle'.
Optional argument TARGET-FILE can be used to specify a default
export file for all source blocks. Optional argument LANG can be
used to limit the exported source code blocks by language."
used to limit the exported source code blocks by language.
Return a list whose CAR is the tangled file name."
(interactive "fFile to tangle: \nP")
(let ((visited-p (get-file-buffer (expand-file-name file)))
to-be-removed)
(save-window-excursion
(find-file file)
(setq to-be-removed (current-buffer))
(org-babel-tangle nil target-file lang))
(unless visited-p
(kill-buffer to-be-removed))))
(prog1
(save-window-excursion
(find-file file)
(setq to-be-removed (current-buffer))
(org-babel-tangle nil target-file lang))
(unless visited-p
(kill-buffer to-be-removed)))))
(defun org-babel-tangle-publish (_ filename pub-dir)
"Tangle FILENAME and place the results in PUB-DIR."

View File

@ -199,7 +199,8 @@ file to byte-code before it is loaded."
;; tangle if the org-mode file is newer than the elisp file
(unless (and (file-exists-p exported-file)
(> (funcall age file) (funcall age exported-file)))
(org-babel-tangle-file file exported-file "emacs-lisp"))
(setq exported-file
(car (org-babel-tangle-file file exported-file "emacs-lisp"))))
(message "%s %s"
(if compile
(progn (byte-compile-file exported-file 'load)