From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Subject: Re: markup text with leading, trailing spaces Date: Fri, 13 Feb 2015 17:31:41 -0500 Message-ID: <87wq3ligtu.fsf@yale.edu> References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMOqN-0008Pe-9t for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:36:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMOqJ-0004Tw-8F for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:36:15 -0500 Received: from plane.gmane.org ([80.91.229.3]:44891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMOqJ-0004Tc-2B for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:36:11 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YMOqG-00009g-9D for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 23:36:08 +0100 Received: from nat-130-132-173-151.central.yale.edu ([130.132.173.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Feb 2015 23:36:08 +0100 Received: from jorge.alfaro-murillo by nat-130-132-173-151.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Feb 2015 23:36:08 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 > > #+BEGIN_SRC > command1 > command2 > command3 > #+END_SRC > > 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 (org-babel-do-load-languages 'org-babel-load-languages '((shell . t))) #+END_SRC 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" cd ls n=1 while [ $n -le 10 ]; do echo $n n=$(( n + 1 )) done echo "bye" #+END_SRC Best, -- Jorge.