emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* entity font-locking problem when inserting text in middle of buffer
@ 2010-06-03 19:23 Eric S Fraga
  2010-06-04  6:34 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2010-06-03 19:23 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]

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.

If, instead, point were at the first "t" in "some text", there's no
problem inserting "\left".

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... ;-).

Back to writing... ;-)


[-- Attachment #2: x.jpg --]
[-- Type: image/jpeg, Size: 75700 bytes --]

[-- Attachment #3: Type: text/plain, Size: 75 bytes --]

-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: entity font-locking problem when inserting text in middle of buffer
  2010-06-03 19:23 entity font-locking problem when inserting text in middle of buffer Eric S Fraga
@ 2010-06-04  6:34 ` Carsten Dominik
  2010-06-04  7:05   ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2010-06-04  6:34 UTC (permalink / raw)
  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... ;-).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: entity font-locking problem when inserting text in middle of buffer
  2010-06-04  6:34 ` Carsten Dominik
@ 2010-06-04  7:05   ` Eric S Fraga
  0 siblings, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2010-06-04  7:05 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

On Fri, 4 Jun 2010 08:34:05 +0200, Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
> 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...

[...]

> I think that it should behave much better now, please give it a try.
> Also the problem in comment lines should be gone, hopefully.

Both aspects working just fine this morning!  Many thanks.

> > 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:

yes, time to look at org-cdlatex-mode again.  I did look at it a while
ago but it kind of dropped out of my conscious mind because I didn't
really need it at that time (partly because this was before org beamer
support...).  Thanks for the reminder.

[-- Attachment #2: Type: text/plain, Size: 75 bytes --]

-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-04  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-03 19:23 entity font-locking problem when inserting text in middle of buffer Eric S Fraga
2010-06-04  6:34 ` Carsten Dominik
2010-06-04  7:05   ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).