From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uriel Avalos Subject: Re: How to insert apostrophe (') into code and verbatim text? Date: Fri, 5 Feb 2010 11:09:22 -0500 Message-ID: <20100205110922.18091522@yahoo.com> References: <20100204114838.330cbb08@yahoo.com> <10085.1265302410@gamaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdPfy-00049R-CF for emacs-orgmode@gnu.org; Fri, 05 Feb 2010 10:00:54 -0500 Received: from [199.232.76.173] (port=54001 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdPfx-00048v-MO for emacs-orgmode@gnu.org; Fri, 05 Feb 2010 10:00:53 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdPfv-0003mf-Kv for emacs-orgmode@gnu.org; Fri, 05 Feb 2010 10:00:53 -0500 Received: from outbound-mail-01.bluehost.com ([69.89.21.11]:56732) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NdPfv-0003mX-8w for emacs-orgmode@gnu.org; Fri, 05 Feb 2010 10:00:51 -0500 Received: from [64.61.28.170] (helo=localhost.localdomain) by host300.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1NdPft-0005nd-S0 for emacs-orgmode@gnu.org; Fri, 05 Feb 2010 08:00:50 -0700 In-Reply-To: <10085.1265302410@gamaville.dokosmarshall.org> 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: emacs-orgmode@gnu.orgemacs-orgmode@gnu.org So I guess it's too complicated for the gurus. :-) I'm already doing '=life= but I thought perhaps there was a quick hack to get ='life= to work. Oh well, not a biggie, life moves on... On Thu, 04 Feb 2010 11:53:30 -0500 Nick Dokos wrote: > Uriel Avalos wrote: > > > Here's an easy one for the guru's, why does an apostrophe at the beginning of a =code= not work? When I export the following text to HTML, the "'life" variable isn't set as code (and the = symbols show up): > > > > Select ='life= for the x variable. > > > > If I escape the apostrophe, I course get back the escape character in the HTML: > > > > Select =\'life= for the x variable. > > > > Emphasis is applied by matching against a regular expression stored in the variable > org-emph-re. I get > > ,---- > | org-emph-re is a variable defined in `org.el'. > | Its value is > | "\\([ ('\"{]\\|^\\)\\(\\([*/_=~+]\\)\\([^ > \n,\"']\\|[^ > \n,\"'].*?\\(?:\n.*?\\)\\{0,1\\}[^ > \n,\"']\\)\\3\\)\\([- .,:!?;'\")}\\]\\|$\\)" > | > | Documentation: > | Regular expression for matching emphasis. > `---- > > which is way too complicated for my simple mind to wrap around without > some guidance. But the doc for org-export-with-emphasize says: > > ,---- > | org-export-with-emphasize is a variable defined in `org-exp.el'. > | Its value is t > | > | Documentation: > | Non-nil means, interpret *word*, /word/, and _word_ as emphasized text. > | If the export target supports emphasizing text, the word will be > | typeset in bold, italic, or underlined, respectively. Works only for > | single words, but you can say: I *really* *mean* *this*. > | Not all export backends support this. > | > | This option can also be set with the +OPTIONS line, e.g. "*:nil". > `---- > > so *words* are emphasized[1]. > > Can you write > > Select '=life= for the x variable. > > instead? The quote is not part of the block, but does that > make much difference? And if it does, a little postprocessing on the > HTML might be all that is needed[2]. > > HTH, > Nick > > [1] although after staring at it for a while and with the hindsight > provided by the org-export-with-emphasize doc, the part that goes [^ ^M\n,\"'] > specifically excludes spaces, tabs, carriage returns, newlines, > commas, double quotes and single quotes as components of words. > > [2] You might try changing the RE (it is constructed in > org.el:org-set-emph-re()) - but regular expressions are very unforgiving > beasts: you forget one character or add one too many and the whole thing > goes to hell in a handbasket, faster than a bat out of hell - choose > your own cliche' :-) -- --Thanks! Uriel