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: Mon, 11 Feb 2019 20:15:36 -0300 Message-ID: References: <87bm3it0u9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:47825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtKo3-0006pJ-CR for emacs-orgmode@gnu.org; Mon, 11 Feb 2019 18:16:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtKo2-0001pu-3H for emacs-orgmode@gnu.org; Mon, 11 Feb 2019 18:16:07 -0500 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:46281) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtKo1-0001QH-Bv for emacs-orgmode@gnu.org; Mon, 11 Feb 2019 18:16:05 -0500 Received: by mail-yw1-xc43.google.com with SMTP id n12so258705ywn.13 for ; Mon, 11 Feb 2019 15:15:48 -0800 (PST) In-Reply-To: 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: emacs-orgmode@gnu.org A last suggestion. Incidentally the toggle returns nil when at least a fragment is unpreviewed and non-nil otherwise (as a side effect of message). This can be documented and made part of the interface, so that something like the following can be put together by the end user: (defun my-org-preview-latex (&optional arg) (interactive "P") (unless (org-toggle-latex-fragment arg) (org-toggle-latex-fragment arg))) I insist on the importance of the use case "force preview" because it's very useful to quickly jot down a paragraph or part of a paragraph with many simple latex fragments like $x_i$, $f(x)$, etc. and then, afterwards, type C-c C-x C-l to preview the last entered part of the paragraph, instead of painfully entering C-c C-x C-l after any single $x$ or similar. Now, if the toggle prefers removing previews as it's the case, this won't work because, in general, you already have some preview in the same section or paragraph.