emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: org-toggle-latex-fragment doesn't work as documented [9.2.1


From: Carlos Pita
Subject: Re: [O] Bug: org-toggle-latex-fragment doesn't work as documented [9.2.1 (release_9.2.1-60-gb0379f @ /home/carlos/local/stow/emacs/share/emacs/site-lisp/org/)]
Date: Tue, 12 Feb 2019 20:23:34 -0300

> `C-c C-x C-S-l` is too ugly, even for me. It is a convention we don't
> use in Org.

Mmm ok :).

I proposed it because it is easy to remember if you think you're
modifying a base action by S and also because it's easier to keep C
pressed (versus simply S-l or M-l).

So lets play with minus as a modifier, I like that idea.

(A) Here is a variation of my proposal:

[C- -] [C-u] [C-u] C-c C-x C-l

The modifier [C- -] means force preview.
The modifier [C-u] means section scope.
The modifier [C-u][C-u] means document scope.

So - means force, C-u means section, C-u C-u means document.

One advantage of this approach is backwards compatibility.

(B) Here is a variation of your proposal. In it - means clear (I find
this a good mnemonic since "minus removes stuff"):

- C-c C-x C-l :: Toggle preview on the fragment at point, raise an
    error outside a fragment
- C-u C-c C-x C-l :: *Preview* for current section
- C-- C-u C-c C-x C-l :: *Clear preview* from the current section
- C-u C-u C-c C-x C-l :: *Preview* the whole document
- C-- C-u C-u C-c C-x C-l :: *Clear preview* for the whole document

So - means clear, C-u means section, C-u C-u means document.

> This doesn't solve the overlapping between `C-c C-x C-l' and `C-u C-x
> C-l' either.

I know I mentioned this overlapping but that was the result of a
confusion of mine: at first I mistakenly thought the C-u modifiers
were there to force preview clearing. But I don't think the
section-scope overlapping between C-u C-c C-x C-l and C-c C-x C-l when
used outside a fragment is a such bad thing. The C-u modifiers can be
thought as setting "strict scopes" of operation while the vanilla
operation tries to be smart. The problem with this smartness is not
the overlapping per se but that the meaning of "toggle" is ill defined
when you have a mixed set of un/previewed fragments. Therefore,
although I'm ok with the section-scope overlapping, I agree that it
could be convenient to ban the toggling behavior altogether except for
single fragments, for which it's well defined. But backwards
compatibility is a balancing consideration.

I'm fine with both (A) and (B) above. (A) is backwards compatible and
(B) removes the somewhat surprising toggle behavior when outside a
fragment (which motivated this report).

Best regards
--
Carlos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]