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: Wed, 13 Feb 2019 16:38:37 -0300 Message-ID: References: <87bm3it0u9.fsf@gmail.com> <874l98vfxw.fsf@nicolasgoaziou.fr> <87va1otypx.fsf@nicolasgoaziou.fr> <87a7izu5n4.fsf@nicolasgoaziou.fr> <87r2cbsllf.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000dfda7f0581cbb059" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:58080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gu0Mz-0006hs-Na for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 14:38:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gu0Mx-00015r-Mu for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 14:38:57 -0500 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]:42949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gu0Mv-0000YE-ET for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 14:38:55 -0500 Received: by mail-yb1-xb2c.google.com with SMTP id j189so1396805ybj.9 for ; Wed, 13 Feb 2019 11:38:50 -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: Carlos Pita , emacs-orgmode --000000000000dfda7f0581cbb059 Content-Type: text/plain; charset="UTF-8" Nicolas, here is a patch implementing alternative B above with ORG-NEWS entry and everything. I have been playing with it and find the bindings quite handy. Code is indeed a bit simpler. If you like it, feel free to amend it before merging. Best regards -- Carlos --000000000000dfda7f0581cbb059 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-org-Make-latex-preview-toggle-more-useful-and-predic.patch" Content-Disposition: attachment; filename="0001-org-Make-latex-preview-toggle-more-useful-and-predic.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_js3lleb40 RnJvbSA3OTllY2QzMzJlODFhMzFiMDZmNjliYTU1NDZkYjc0ZWI5NTgzYmE3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBtZW1lcGxleCA8Y2FybG9zam9zZXBpdGFAZ21haWwuY29tPgpE YXRlOiBXZWQsIDEzIEZlYiAyMDE5IDE2OjI2OjQ2IC0wMzAwClN1YmplY3Q6IFtQQVRDSF0gb3Jn OiBNYWtlIGxhdGV4IHByZXZpZXcgdG9nZ2xlIG1vcmUgdXNlZnVsIGFuZCBwcmVkaWN0YWJsZQoK KiBsaXNwL29yZy5lbCAob3JnLXRvZ2dsZS1sYXRleC1mcmFnbWVudCk6CiAgLSBBdm9pZCB0b2dn bGluZyBiZWhhdmlvciBmb3Igc3VidHJlZS9idWZmZXIgc2NvcGUKICAtIE1ha2UgY29tbW9uIHVz ZSBjYXNlcyBzaW1wbGVyIHRvIHR5cGUKCiogRGV0YWlsZWQgZGlzY3Vzc2lvbjoKCiAgaHR0cDov L2xpc3RzLmdudS5vcmcvYXJjaGl2ZS9odG1sL2VtYWNzLW9yZ21vZGUvMjAxOS0wMi9tc2cwMDEz OC5odG1sCi0tLQogbGlzcC9vcmcuZWwgfCA3MSArKysrKysrKysrKysrKysrKysrKysrKysrKy0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDM1IGluc2VydGlvbnMo KyksIDM2IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3Avb3JnLmVsIGIvbGlzcC9vcmcu ZWwKaW5kZXggMDAzMDU4NDM0Li5hZmQzZjg3MDk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