Browse Source

attempts at improving sb snippet

Eric Schulte 16 years ago
parent
commit
a54c27ec91
2 changed files with 15 additions and 2 deletions
  1. 14 1
      org-babel.org
  2. 1 1
      snippets/org-mode/sb

+ 14 - 1
org-babel.org

@@ -114,9 +114,22 @@ table, allowing the test suite to be run be evaluation of the table
 and the results to be collected in the same table.
 
 
-* Tasks [20/29]
+* Tasks [20/32]
 ** TODO improve the source-block snippet
+
 [[file:~/src/emacs-starter-kit/src/snippets/text-mode/rst-mode/chap::name%20Chapter%20title][file:~/src/emacs-starter-kit/src/snippets/text-mode/rst-mode/chap::name Chapter title]]
+#+begin_example
+,#name : Chapter title
+,# --
+${1:Chapter}
+${1:$(make-string (string-width text) ?\=)}
+
+$0
+#+end_example
+
+[[file:snippets/org-mode/sb][sb -- snippet]]
+
+waiting for guidance from those more familiar with yasnippets
 
 ** TODO resolve references to other buffers
    This would allow source blocks to call upon tables, source-blocks,

+ 1 - 1
snippets/org-mode/sb

@@ -1,6 +1,6 @@
 #name : #+begin_src...#+end_src
 # --
-#+srcname: ${1:name}
+${1:$(if (> (length text) 1) "#+srcname:" "")} ${1: }
 #+begin_src ${2:language} $3
 $0
 #+end_src