From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: entity font-locking problem when inserting text in middle of buffer Date: Fri, 4 Jun 2010 08:34:05 +0200 Message-ID: References: <87d3w7gbtq.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=34573 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKQTx-00021Z-KR for emacs-orgmode@gnu.org; Fri, 04 Jun 2010 02:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKQTs-0003Xx-NT for emacs-orgmode@gnu.org; Fri, 04 Jun 2010 02:34:17 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:42756) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKQTs-0003Xp-EU for emacs-orgmode@gnu.org; Fri, 04 Jun 2010 02:34:12 -0400 Received: by ewy6 with SMTP id 6so470403ewy.32 for ; Thu, 03 Jun 2010 23:34:11 -0700 (PDT) In-Reply-To: <87d3w7gbtq.wl%ucecesf@ucl.ac.uk> 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: Eric S Fraga Cc: org-mode mailing list Hi Eric, On Jun 3, 2010, at 9:23 PM, Eric S Fraga wrote: > Hello, > > I don't think this is something that can be fixed but it has been > driving me crazy so I thought I'd email to point it out in case > anybody else runs into it. If you have org-pretty-entities set to t, > org-mode does a lovely job of showing all kinds of characters. > However, the regexp for the font-locking for this makes sense for when > adding text to the end of a buffer or with point immediately before > any :alnum: character (e.g. not a space). It makes less sense if you > start inserting some text in the middle of a sentence, say, which I do > often when writing papers... > > See attached image for an example. If you have something like "some > text", place point after the first "e" and start typing "\left", as > soon as you type the "e", you will get the \le symbol despite typing > the "f" immediately after. The regexp for font-locking is fine for > converting text that has already been typed; it is less effective when > inserting the text. I think that it should behave much better now, please give it a try. Also the problem in comment lines should be gone, hopefully. > > If, instead, point were at the first "t" in "some text", there's no > problem inserting "\left". Good opportunity to plug cdlatex.el. If you have it installed and then turn on org-cdlatex-mode, one of the many things that will work then is: You type l r { TAB and get \left\{ \right\} with the cursor in the middle. Similarly: You type f r TAB and get \frac{}{} with the cursor in the first set of braces, TAB will move you into the second, and then out. If you are using a lot of math, this should be quite helpful. Cheers - Carsten > > Unfortunately, I cannot suggest a fix. It's not that serious a > problem; I just wanted to highlight it for the mailing list. > > In the image, you'll also see that there are some problems with > underlined text when org-hide-emphasis-markers is set to t. Again, > not a serious problem (and underlining is really a hold-over from > typewriter days, as I believe Carsten would say... ;-).