From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou 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: Wed, 13 Feb 2019 15:25:51 +0100 Message-ID: <87a7izu5n4.fsf@nicolasgoaziou.fr> References: <87bm3it0u9.fsf@gmail.com> <874l98vfxw.fsf@nicolasgoaziou.fr> <87va1otypx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:37304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtvU6-000649-0Y for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 09:25:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtvU4-0002RI-OC for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 09:25:57 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:38645) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtvU4-0002OT-Dl for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 09:25:56 -0500 In-Reply-To: (Carlos Pita's message of "Tue, 12 Feb 2019 20:23:34 -0300") 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 Cc: emacs-orgmode Hello, Carlos Pita writes: > 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 is daunting. I have another, simpler, suggestion. First, we can drop document scope altogether. We may still provide a command for it, but binding it seems not useful. Also, if we keep the "smart" behaviour of `C-c C-x C-l', we can also get rid of section scope. This leaves plenty of space to distinguish between previewing and clearing previews. Concretely - `C-c C-x C-l' :: When on a LaTeX fragment, toggle previewing, as usual. Outside of LaTeX fragment, preview the whole section, unconditionally. In particular, if there is nothing (more) to preview, do nothing. - `C-u C-c C-x C-l' :: Clear all previews in the current section, unconditionally. There is no overlap, clearing previews is still fast, and you can preview LaTeX fragments incrementally. If we absolutely need to bind document preview, we can still keep it bound in `C-u 0 C-c C-x C-l' (`C-u - C-c C-x C-l' to clear), but it doesn't need a binding out of the box. WDYT? Regards, -- Nicolas Goaziou