emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
@ 2014-02-23 11:24 Anders Johansson
  2014-02-23 11:50 ` Anders Johansson
  2014-03-04 22:26 ` shwouchk
  0 siblings, 2 replies; 7+ messages in thread
From: Anders Johansson @ 2014-02-23 11:24 UTC (permalink / raw)
  To: emacs-orgmode

Hi,
I used the configuration:

org-catch-invisible-edits 'show
org-pretty-entities t

together with org-cdlatex. This breaks the insertion of subscripts and 
superscripts through org-cdlatex because _{} is fontified and the {} are 
hidden so typing for example: "a _ bc" results in "a_{b}c" (or sometimes 
"a_bc", but should be "a_{bc}") and gives the message "Unfolding 
invisible region around point before editing".

Setting org-catch-invisible-edits to nil let's cdlatex do it's work so I 
guess an easy solution would be to "let" that in 
org-cdlatex-underscore-caret.


Cheers,
Anders Johansson

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-02-23 11:24 Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits Anders Johansson
@ 2014-02-23 11:50 ` Anders Johansson
  2014-02-23 15:20   ` Anders Johansson
  2014-03-04 22:26 ` shwouchk
  1 sibling, 1 reply; 7+ messages in thread
From: Anders Johansson @ 2014-02-23 11:50 UTC (permalink / raw)
  To: emacs-orgmode

> Hi,
> I used the configuration:
>
> org-catch-invisible-edits 'show
> org-pretty-entities t
>
> together with org-cdlatex. This breaks the insertion of subscripts and 
> superscripts through org-cdlatex because _{} is fontified and the {} 
> are hidden so typing for example: "a _ bc" results in "a_{b}c" (or 
> sometimes "a_bc", but should be "a_{bc}") and gives the message 
> "Unfolding invisible region around point before editing".
>
> Setting org-catch-invisible-edits to nil let's cdlatex do it's work so 
> I guess an easy solution would be to "let" that in 
> org-cdlatex-underscore-caret.
>
>
> Cheers,
> Anders Johansson
Hi,
I realized that my solution won't work since 
"org-check-before-invisible-edit" does it's work after 
"org-cdlatex-underscore-caret" has called "cdlatex-sub-superscript" and 
inserted "_{}".

Maybe then org-catch-invisible-edits should be nil all the time in 
org-cdlatex-mode? But this would be unexpected. Maybe this can be 
treated as a special case in "org-check-before-invisible-edit" in some way?


Cheers,
Andes Johansson

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-02-23 11:50 ` Anders Johansson
@ 2014-02-23 15:20   ` Anders Johansson
  2014-03-15 13:54     ` Anders Johansson
  0 siblings, 1 reply; 7+ messages in thread
From: Anders Johansson @ 2014-02-23 15:20 UTC (permalink / raw)
  To: emacs-orgmode


>> Hi,
>> I used the configuration:
>>
>> org-catch-invisible-edits 'show
>> org-pretty-entities t
>>
>> together with org-cdlatex. This breaks the insertion of subscripts 
>> and superscripts through org-cdlatex because _{} is fontified and the 
>> {} are hidden so typing for example: "a _ bc" results in "a_{b}c" (or 
>> sometimes "a_bc", but should be "a_{bc}") and gives the message 
>> "Unfolding invisible region around point before editing".
>>
>> Setting org-catch-invisible-edits to nil let's cdlatex do it's work 
>> so I guess an easy solution would be to "let" that in 
>> org-cdlatex-underscore-caret.
>>
> Hi,
> I realized that my solution won't work since 
> "org-check-before-invisible-edit" does it's work after 
> "org-cdlatex-underscore-caret" has called "cdlatex-sub-superscript" 
> and inserted "_{}".
>
> Maybe then org-catch-invisible-edits should be nil all the time in 
> org-cdlatex-mode? But this would be unexpected. Maybe this can be 
> treated as a special case in "org-check-before-invisible-edit" in some 
> way?
>
Digging into it some more it's actually the "pretty entities" folding 
which is the problem, regardless of org-check-before-invisible-edit. The 
cursor jumps out of the {}-brackets after the first character, when the 
hiding/folding is done. I have no idea what should be done about this.

Cheers,
Anders Johansson

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-02-23 11:24 Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits Anders Johansson
  2014-02-23 11:50 ` Anders Johansson
@ 2014-03-04 22:26 ` shwouchk
  2014-03-15  6:29   ` Bastien
  1 sibling, 1 reply; 7+ messages in thread
From: shwouchk @ 2014-03-04 22:26 UTC (permalink / raw)
  To: emacs-orgmode

Hello Anders,

Anders Johansson <mejlaandersj <at> gmail.com> writes:

> 
> Hi,
> I used the configuration:
> 
> org-catch-invisible-edits 'show
> org-pretty-entities t


Did you fish around enough to find a workaround? I have the same problem...

Cheers!

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-03-04 22:26 ` shwouchk
@ 2014-03-15  6:29   ` Bastien
  2014-03-15 16:31     ` Shwouchk
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2014-03-15  6:29 UTC (permalink / raw)
  To: shwouchk; +Cc: emacs-orgmode

Hi,

you want to set

(setq org-pretty-entities-include-sub-superscripts nil)

before using `org-cdlatex-mode'.

HTH,

-- 
 Bastien

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-02-23 15:20   ` Anders Johansson
@ 2014-03-15 13:54     ` Anders Johansson
  0 siblings, 0 replies; 7+ messages in thread
From: Anders Johansson @ 2014-03-15 13:54 UTC (permalink / raw)
  To: emacs-orgmode

2014-02-23 16:20, Anders Johansson wrote:
>
>>> Hi,
>>> I used the configuration:
>>>
>>> org-catch-invisible-edits 'show
>>> org-pretty-entities t
>>>
>>> together with org-cdlatex. This breaks the insertion of subscripts
>>> and superscripts through org-cdlatex because _{} is fontified and the
>>> {} are hidden so typing for example: "a _ bc" results in "a_{b}c" (or
>>> sometimes "a_bc", but should be "a_{bc}") and gives the message
>>> "Unfolding invisible region around point before editing".
>>>
>>> Setting org-catch-invisible-edits to nil let's cdlatex do it's work
>>> so I guess an easy solution would be to "let" that in
>>> org-cdlatex-underscore-caret.
>>>
>> Hi,
>> I realized that my solution won't work since
>> "org-check-before-invisible-edit" does it's work after
>> "org-cdlatex-underscore-caret" has called "cdlatex-sub-superscript"
>> and inserted "_{}".
>>
>> Maybe then org-catch-invisible-edits should be nil all the time in
>> org-cdlatex-mode? But this would be unexpected. Maybe this can be
>> treated as a special case in "org-check-before-invisible-edit" in some
>> way?
>>
> Digging into it some more it's actually the "pretty entities" folding
> which is the problem, regardless of org-check-before-invisible-edit. The
> cursor jumps out of the {}-brackets after the first character, when the
> hiding/folding is done. I have no idea what should be done about this.
>


In case anyone has the same problem, my current workaraound for this is 
disabling "pretty entities" for sub/superscript when using cdlatex:

(add-hook 'cdlatex-mode-hook
  (lambda () (when (eq major-mode 'org-mode)
   (make-local-variable 'org-pretty-entities-include-sub-superscripts)
    (setq org-pretty-entities-include-sub-superscripts nil))))


Cheers,
Anders Johansson

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

* Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
  2014-03-15  6:29   ` Bastien
@ 2014-03-15 16:31     ` Shwouchk
  0 siblings, 0 replies; 7+ messages in thread
From: Shwouchk @ 2014-03-15 16:31 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

Bastien,

Aaaah, thanks, it works great!
I looked for hours for a setting of the sort...

I do still think that this is a bug however: when I don't use the setting
you provided and don't use pretty-entities, after I place the
sub/superscript sign, the point gets places inside the braces. If I do use
pretty-entities however, the cursor gets placed *after* the brace pair, and
this is what causes problems - I would expect the point to get inside the
brace pair, as at least to my understanding, pretty-entities should change
the way things look, but not how they behave... What do you think?

Other than that, I have a feature suggestion that I'm throwing out there:
It would be really cool
I think it would be really cool if there was an option to expand
sub/superscript braces when the point is near them.

Other than that, I also noticed that after I export to PDF, my kill-ring
gets filled with a bunch of tex and/or output pieces. Is this
expected/known behaviour or should I investigate it further on my end?

Thanks,
Kosta


--
Kliakhandler Kosta
       Contact:
+972-547-567-052
 +1-347-281-7218
kosta@slumpy.org
 http://slumpy.org
       )°) )°( (°(


On Sat, Mar 15, 2014 at 8:29 AM, Bastien <bzg@gnu.org> wrote:

> Hi,
>
> you want to set
>
> (setq org-pretty-entities-include-sub-superscripts nil)
>
> before using `org-cdlatex-mode'.
>
> HTH,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 3576 bytes --]

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

end of thread, other threads:[~2014-03-15 16:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-23 11:24 Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits Anders Johansson
2014-02-23 11:50 ` Anders Johansson
2014-02-23 15:20   ` Anders Johansson
2014-03-15 13:54     ` Anders Johansson
2014-03-04 22:26 ` shwouchk
2014-03-15  6:29   ` Bastien
2014-03-15 16:31     ` Shwouchk

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