From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos Pita Subject: Re: 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 Message-ID: References: <87bm3it0u9.fsf@gmail.com> <874l98vfxw.fsf@nicolasgoaziou.fr> <87va1otypx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:36651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gthP9-00026P-SF for emacs-orgmode@gnu.org; Tue, 12 Feb 2019 18:23:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gthP7-00075C-3S for emacs-orgmode@gnu.org; Tue, 12 Feb 2019 18:23:54 -0500 Received: from mail-yw1-xc30.google.com ([2607:f8b0:4864:20::c30]:46959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gthP6-0006xk-Tg for emacs-orgmode@gnu.org; Tue, 12 Feb 2019 18:23:53 -0500 Received: by mail-yw1-xc30.google.com with SMTP id n12so168923ywn.13 for ; Tue, 12 Feb 2019 15:23:46 -0800 (PST) In-Reply-To: <87va1otypx.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Carlos Pita , emacs-orgmode > `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