From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Exporting blocks without removing indentation Date: Wed, 28 Oct 2009 11:14:48 -0700 Message-ID: <20524da70910281114v114e8443k90cf5bd32ca9dfe5@mail.gmail.com> References: <87ljivlk9s.fsf@stats.ox.ac.uk> <064DBD81-9D10-46D6-911B-67E83EE10A11@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3D2t-00078O-AW for emacs-orgmode@gnu.org; Wed, 28 Oct 2009 14:14:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3D2n-00076l-IA for emacs-orgmode@gnu.org; Wed, 28 Oct 2009 14:14:53 -0400 Received: from [199.232.76.173] (port=33399 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3D2n-00076i-Ei for emacs-orgmode@gnu.org; Wed, 28 Oct 2009 14:14:49 -0400 Received: from mail-iw0-f201.google.com ([209.85.223.201]:45676) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3D2n-0000Vi-64 for emacs-orgmode@gnu.org; Wed, 28 Oct 2009 14:14:49 -0400 Received: by iwn39 with SMTP id 39so1166909iwn.25 for ; Wed, 28 Oct 2009 11:14:48 -0700 (PDT) In-Reply-To: <064DBD81-9D10-46D6-911B-67E83EE10A11@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Dan Davison , emacs org-mode mailing list It's probably too late to suggest this, but it might be that long options are more easy to remember for users than short options? Also, they might be easier to look up in the manual if you use a non-Emacs browser. On 2009-10-28, Carsten Dominik wrote: > Hi Dan, > > maybe the easiest way to implement this would be a -i (or whatever) > switch a the src block. > > Switches are being processed already, so it will be simple to add one, > I think. > > - Carsten > > On Oct 28, 2009, at 2:29 PM, Dan Davison wrote: > >> Fairly late in the export process, org-exp removes the common >> indentation from lines inside blocks (line 2288 of org-exp.el): >> >> (setq rtn (org-remove-indentation code)) >> >> However, what do we do if >> >> 1. A user has a block that she wishes to export with the indentation >> intact? >> >> 2. An org-exp-blocks plugin has a block that it wishes to export with >> the indentation intact? >> >> I propose that we make (1) and (2) possible. An example where (1) >> arises >> is if, when documenting a moderately complex program, different >> parts of >> a class or function are contained in separate blocks. >> >> Q1. Is that aim approved of? >> >> (2) is a bit trickier than (1). To solve (1), we could introduce a fix >> in org-exp.el like >> >> - (setq rtn (org-remove-indentation code)) >> + (setq rtn (if org-src-preserve-indentation code >> + (org-remove-indentation code))) >> >> However in solving (2) the plugin cannot assume that the variable >> org-src-preserve-indentation is in effect (in fact it very likely >> isn't). So we need to come up with a way in which the block resulting >> from an org-exp-blocks plugin can have its indentation survive through >> to the export product, even if org-src-preserve-indentation is >> globally >> nil. Two possibilities are >> >> 1. We adopt a convention whereby if all lines start with some >> character >> (say ,) then that character is removed (but the remaining >> indentation >> is left intact.) >> >> 2. We transplant the indentation-removing work from org-exp.el into >> org-exp-blocks.el, and arrange that it is only performed if the >> block >> is *not* handled by an org-exp-blocks plugin. >> >> Q2. Has this made sense? What solution do you suggest? >> >> Q3. Should we use org-src-preserve-indentation in this way to affect >> export? (It currently has effect when switching between the org buffer >> and the code edit buffer.) >> >> Dan >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > - Carsten > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- Q: How many CDC "scientists" does it take to change a lightbulb? A: "You only think it's dark." [CDC has denied ME/"CFS" for 25 years] ===================================================================== Retrovirus: http://www.wpinstitute.org/xmrv/xmrv_qa.html