hymie! writes:

I'd like to be able to have a series of commands in my raw org file that I can copy-n-paste into my shell window. But I also like to export my org files to HTML so that I can make ePubs and keep them in my iPad.

And this


is just IMO ugly.

It shouldn't be. Try adding the word "shell" after BEGIN_SRC, so that it fontifies the code correctly (the variable org-src-fontify-natively should be set to t, but that has been default for a while). Also, add shell to the loaded babel languages, so that you can execute the code and get the results right away in org:

#+BEGIN_SRC emacs-lisp
      '((shell . t)))

No need for "copy-n-paste", just do C-c C-c where you have your commands. Another added benefit is that it is way easier to add the shell scripts inside a SRC block after you press C-c ' (C-c ' again to go back to your org file), since then you will have the power of Shell-script mode available, for example:

C-c (    to define a function
C-c TAB  for an if statement
C-c C-l  for an indexed loop

Try copying this example into an org file, it should fontify it nicely, both in the org file and in the html exported.

#+BEGIN_SRC shell
 echo "hello"
 while [ $n -le 10 ]; do
     echo $n
     n=$(( n + 1 ))
 echo "bye"



Reply via email to