From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: How to add comments in a plain list Date: Tue, 22 Sep 2009 13:10:09 +0100 Message-ID: References: <87r5tzhawh.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mq4CE-0004fZ-Qs for emacs-orgmode@gnu.org; Tue, 22 Sep 2009 08:10:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mq4CD-0004es-Px for emacs-orgmode@gnu.org; Tue, 22 Sep 2009 08:10:14 -0400 Received: from [199.232.76.173] (port=34774 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mq4CD-0004eY-Gp for emacs-orgmode@gnu.org; Tue, 22 Sep 2009 08:10:13 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:7996) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mq4CD-0000hp-28 for emacs-orgmode@gnu.org; Tue, 22 Sep 2009 08:10:13 -0400 Received: by fg-out-1718.google.com with SMTP id 22so1232159fge.12 for ; Tue, 22 Sep 2009 05:10:12 -0700 (PDT) In-Reply-To: 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: =?ISO-8859-1?Q?Ren=E9?= Cc: emacs-orgmode@gnu.org On Sep 22, 2009, at 12:32 PM, Ren=E9 wrote: > Bernt Hansen norang.ca> writes: >> You can ident the comment like this >> >> 1. first >> 2. second >> >> # comment about second item >> >> 3. third >> 4. fourth > > Unfortunately in this case your comment gets exported since the `#' =20= > is indented. > > Of course one doesn't want the comments to appear in the html =20 > version of the > document. > > Is there a way to easily solve this issue? You can always add a function to one of the org-export-preprocess-... =20= hooks. However, if you are not careful, you might remove something like #!/bin/sh in a source code block, or some normal text where, #25 starts a new line by accident. It may be relatively safe to look for # followed by space, or lines that have only "#" ad the only nonwhite character on a line. Something like this might work (untested) (add-hook 'org-export-preprocess-before-backend-specifics-hook (lambda () (goto-char (point-min)) (while (re-search-forward "^[ \t]+#\\([ \t]*$\\| .*$\\)\n?" nil t) (org-if-unprotected-at (match-beginning 1) (replace-match ""))))) HTH - Carsten=