From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SFO9C1OUoGK4sQAAbAwnHQ (envelope-from ) for ; Wed, 08 Jun 2022 14:21:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8CXAC1OUoGL0bgEA9RJhRA (envelope-from ) for ; Wed, 08 Jun 2022 14:21:39 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BCCC82A34D for ; Wed, 8 Jun 2022 14:21:38 +0200 (CEST) Received: from localhost ([::1]:41188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyuBl-0002vH-7C for larch@yhetil.org; Wed, 08 Jun 2022 07:49:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nytyh-0007Ri-49 for emacs-orgmode@gnu.org; Wed, 08 Jun 2022 07:36:00 -0400 Received: from mout02.posteo.de ([185.67.36.66]:34487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nytye-0003uc-Nf for emacs-orgmode@gnu.org; Wed, 08 Jun 2022 07:35:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C9798240107 for ; Wed, 8 Jun 2022 13:35:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1654688152; bh=GUBzdlr2Xuoxqhv09XGpQDcJSvD80XD+6C/wKWKGB1M=; h=Date:To:From:Subject:From; b=bQW/iSwRYDoA/cZICjBzEBUtAJNx3uo8zWm8SmZAJymHiOFgo8JMkT1GJBWR0euNO UELPKVkDbYbur7AV2BMUn0M+9dN5lQ6KRvH69SiYCZS1Zio7wb1JYpPyxrHfEbopo/ FV3jdJ1kn3zp/w7jnS441Us3dv/9bp/ZkfRDsjO7+ZCTSMqcAIC6Pmuv/M+3tsI5+E +JSPB2ltBaXy8gIL0W84O0wAqEXLKRN8YKK5I/ZNKdKsNC97W4L5WfJfzgSnOxeaGI 2PcYNloYoFxo9j4wj5EzdkU3iPZsIPYgEBs2oFACJoHdRziBxQZ2j0Ch4ThQZsmxS4 HUmZ/799cgzsA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LJ4t026ldz6tmb for ; Wed, 8 Jun 2022 13:35:52 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------FXUCh4Ay10rN0OyMsNc4aISm" Message-ID: <0af38c34-2513-2f17-8b83-4ba3ad5724d7@posteo.eu> Date: Wed, 8 Jun 2022 11:35:51 +0000 MIME-Version: 1.0 Content-Language: fr To: emacs-orgmode From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Subject: [PATCH] org.el (org-latex-preview): With an active region, act on it Received-SPF: pass client-ip=185.67.36.66; envelope-from=sebastien.miquel@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sebastien.miquel@posteo.eu Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654690898; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1VaBkckdV/e1oRSntmgvB4BklRcSoWNOXcC+QptT9qU=; b=jdlrqCMgBgVOaDDsFjlxuBVI10uh8q5X3BKjDnUvA6CYUFIKeRhx6MWzvOp3AbWadg5pUM TYTILGE33BMGMuDOheDS6MLftDt4MW6PLTpTz4fctAACukIBzg2/8KlcxXSgMjw2YcfngW ml5n0+AM0u5XiTBa/U5unWt3xteAEU5OjPk8NufaXHDUYFFHPVhqS+ZweYEEZkjKRrJsMO A+wKJooHo6VLVonIY6noSrJ+53Mw39FaAreyjzi+hpbQZc/BLQVA7XdkyUEBYHaQNC43lL mEEWxgUtFB0azbThDnU0rzxnvgKn4RRhEXzli7RBO0/UxzTJBDBlvU9zoaDoRQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654690898; a=rsa-sha256; cv=none; b=i0jBnmXWgHuaD34sHDlPSGLu6xccA1rtVjeEDS+Q1NGT6F0kBUwHM6qEwMvVb7SM7Ecmmb Bq99PnKmPgLI43ctDBiO29J5sMvoyXtHbQGEpgX3fS3ZUOZeqLIGkF0fmwZfLVGoHmY08P ntwedQCP7Ct0Tf8rwGKJwUA1MDfOaA7pF6csVU2NZaE7RYlA6TQkxDalNktq11tbsP33kr 0XED3ihKM8cuff2xGJ/FH8Lqsy2U8ur24gl4eaML7xt2Ss8bwQMHkiRxNrQS857qbqpmwF 5IoMTf58Wb0U1cUyRVal8zQrf3EbNenrV7Mc8q9pihQvWWHRQy/iG+2t2JI/1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.eu header.s=2017 header.b="bQW/iSwR"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.eu header.s=2017 header.b="bQW/iSwR"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BCCC82A34D X-Spam-Score: 7.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: waVoQmgKIQsI This is a multi-part message in MIME format. --------------FXUCh4Ay10rN0OyMsNc4aISm Content-Type: multipart/alternative; boundary="------------EgDX0d1Jer0gxNe8voDo4Eqe" --------------EgDX0d1Jer0gxNe8voDo4Eqe Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, The attached patch modifies org-latex-preview to display all images of latex fragments in a region, when one is active. Using prefix arguments it is already possible to display all images in the buffer, or in the current section, but I find it often too slow and unnecessary. Regards, -- Sébastien Miquel --------------EgDX0d1Jer0gxNe8voDo4Eqe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi,

The attached patch modifies org-latex-preview to display all images
of latex fragments in a region, when one is active.
Using prefix arguments it is already possible to display all images
in the buffer, or in the current section, but I find it often too slow
and unnecessary.

Regards,
-- 
Sébastien Miquel
--------------EgDX0d1Jer0gxNe8voDo4Eqe-- --------------FXUCh4Ay10rN0OyMsNc4aISm Content-Type: text/x-patch; charset=UTF-8; name="0001-org.el-org-latex-preview-With-an-active-region-act-o.patch" Content-Disposition: attachment; filename*0="0001-org.el-org-latex-preview-With-an-active-region-act-o.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAyYzliNzI3MzEyNDc2MjBkZWEyYWVkOTZhMGE4MzM4NTQ3MmUyOWNjIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Uz1DMz1BOWJhc3RpZW49MjBNaXF1 ZWw/PSA8c2ViYXN0aWVuLm1pcXVlbEBwb3N0ZW8uZXU+CkRhdGU6IFdlZCwgOCBKdW4gMjAy MiAxMzoxMToxMiArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIG9yZy5lbCAob3JnLWxhdGV4LXBy ZXZpZXcpOiBXaXRoIGFuIGFjdGl2ZSByZWdpb24sIGFjdCBvbiBpdAoKKiBsaXNwL29yZy5l bCAob3JnLWxhdGV4LXByZXZpZXcpOiBXaXRoIGFuIGFjdGl2ZSByZWdpb24sIGRpc3BsYXkK aW1hZ2VzIGZvciBhbGwgZnJhZ21lbnRzIGluIHRoZSByZWdpb24uIFdpdGggdW5pdmVyc2Fs IHByZWZpeAphcmd1bWVudCwgcmVtb3ZlIGFsbCBpbWFnZXMgaW4gdGhlIHJlZ2lvbi4KLS0t CiBsaXNwL29yZy5lbCB8IDE5ICsrKysrKysrKysrKysrLS0tLS0KIDEgZmlsZSBjaGFuZ2Vk LCAxNCBpbnNlcnRpb25zKCspLCA1IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3Av b3JnLmVsIGIvbGlzcC9vcmcuZWwKaW5kZXggOTVkZmYyN2FkLi4wN2Y0ODE2NDcgMTAwNjQ0 Ci0tLSBhL2xpc3Avb3JnLmVsCisr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bHMgKG9yZy1lbnRyeS1lbmQtcG9zaXRpb24pKSkpCisgICAgIChp ZiAodXNlLXJlZ2lvbi1wKQorICAgICAgICAgKHJlZ2lvbi1iZWdpbm5pbmcpCisgICAgICAg KGlmIChvcmctYmVmb3JlLWZpcnN0LWhlYWRpbmctcCkgKHBvaW50LW1pbikKKyAgICAgICAg IChzYXZlLWV4Y3Vyc2lvbgorCSAgIChvcmctd2l0aC1saW1pdGVkLWxldmVscyAob3JnLWJh Y2stdG8taGVhZGluZyB0KSAocG9pbnQpKSkpKQorICAgICAoaWYgKHVzZS1yZWdpb24tcCkK KyAgICAgICAgIChyZWdpb24tZW5kKQorICAgICAgIChvcmctd2l0aC1saW1pdGVkLWxldmVs cyAob3JnLWVudHJ5LWVuZC1wb3NpdGlvbikpKSkpCisgICAoKHVzZS1yZWdpb24tcCkKKyAg ICAobWVzc2FnZSAiQ3JlYXRpbmcgTGFUZVggcHJldmlld3MgaW4gcmVnaW9uLi4uIikKKyAg ICAob3JnLS1sYXRleC1wcmV2aWV3LXJlZ2lvbiAocmVnaW9uLWJlZ2lubmluZykgKHJlZ2lv bi1lbmQpKQorICAgIChtZXNzYWdlICJDcmVhdGluZyBMYVRlWCBwcmV2aWV3cyBpbiByZWdp b24uLi4gZG9uZS4iKSkKICAgIDs7IFRvZ2dsZSBwcmV2aWV3IG9uIExhVGVYIGNvZGUgYXQg cG9pbnQuCiAgICAoKGxldCAoKGRhdHVtIChvcmctZWxlbWVudC1jb250ZXh0KSkpCiAgICAg ICAoYW5kIChtZW1xIChvcmctZWxlbWVudC10eXBlIGRhdHVtKSAnKGxhdGV4LWVudmlyb25t ZW50IGxhdGV4LWZyYWdtZW50KSkKLS0gCjIuMzYuMQo= --------------FXUCh4Ay10rN0OyMsNc4aISm--