mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-28 10:56:57 +00:00
tangling now preserves order of source-code blocks from the original file
This commit is contained in:
parent
96c8457208
commit
9df56be538
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ other
|
||||
test-tangle.sh
|
||||
test-tangle-none.rb
|
||||
test-tangle-special.rb
|
||||
test-tangle-load.el
|
||||
|
@ -142,8 +142,11 @@ code blocks by language."
|
||||
(setq by-lang (cdr (assoc src-lang blocks)))
|
||||
(setq blocks (delq (assoc src-lang blocks) blocks))
|
||||
(setq blocks (cons (cons src-lang (cons spec by-lang)) blocks))))))
|
||||
;; ensure blocks in the correct order
|
||||
(setq blocks
|
||||
(mapcar (lambda (by-lang) (cons (car by-lang) (reverse (cdr by-lang)))) blocks))
|
||||
;; blocks should contain all source-blocks organized by language
|
||||
;; (message "blocks=%S" blocks) ;; debugging
|
||||
(message "blocks=%S" blocks) ;; debugging
|
||||
blocks))
|
||||
|
||||
(defun org-babel-spec-to-string (spec)
|
||||
|
18
test-tangle-load.org
Normal file
18
test-tangle-load.org
Normal file
@ -0,0 +1,18 @@
|
||||
#+TITLE: testing org-babel-load
|
||||
#+OPTIONS: toc:nil num:nil ^:nil
|
||||
|
||||
* elisp blocks
|
||||
|
||||
** lets look at the order
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(message "I'm the first")
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(message "I'm the second")
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(message "I'm the third")
|
||||
#+end_src
|
Loading…
Reference in New Issue
Block a user