From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qEEXBDR6Y2T2cAEASxT56A (envelope-from ) for ; Tue, 16 May 2023 14:42:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +Eo8AzR6Y2ToJQAAG6o9tA (envelope-from ) for ; Tue, 16 May 2023 14:42:28 +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 B711A1233C for ; Tue, 16 May 2023 14:42:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pytzl-0001ni-Io; Tue, 16 May 2023 08:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pytzk-0001na-By for emacs-orgmode@gnu.org; Tue, 16 May 2023 08:41:36 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pytzi-0004fe-J8 for emacs-orgmode@gnu.org; Tue, 16 May 2023 08:41:36 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6439b410679so9361579b3a.0 for ; Tue, 16 May 2023 05:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684240893; x=1686832893; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:from:to:cc:subject:date:message-id :reply-to; bh=xdTOKpp5aEq3t81h/K7EgCQpTh3nhWZluQ4pZDmDiTI=; b=FsT2jgbg3o5tUbQu//PupPXKkMClPbHGnLG++9ZIQE0JERNDMNkqqG8/YaBCHkaJMU tyj0BKwDdQ7FORJbmSwRZdvW5CYImpBq/fWgP8EOW3dHb7IZ/dQOBtn/jquIHWihp+ED Vq0SWsNOGsPUTJfgraSjfE6l0GmzND+xwtSGTvhnfQAOZw7WlGGHkIXm2mYz3w4S/Qwp LodEefFiW0hA6IQ3yMMC7oFQIDHhb2zKRO0rVQQxQ1ukXFuCeIfnhHa3PmxVAAn8DI3i hJGi4gEyZPz01otlhwDhZobmkDZObaZb8fbew2au9h+BdFosoIJR32RzoXPskFUckPTL waEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684240893; x=1686832893; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xdTOKpp5aEq3t81h/K7EgCQpTh3nhWZluQ4pZDmDiTI=; b=hsgbymJZwa+akOEdiCMgDbcBClMHWhoXE9PHg7PNbtiqColjtzCAGVzwaFL4SRR2ak jPhsiY+wwsgt84M7a+Sr4h1+UuZXpzbZyDDgBbNAhR5uILt8Psi2gbVsI0dl5vbE4Uvm dtI4/5hgqbKRBt+fqxOrEG7xB9UvV4x70G49NLGo6L6cMaIaV4TrP/aYUYJIakPKh/DQ erjr3dx73/RSiCb42sS0qE+oNyJTHiFHTw1RAB6HNfj64h2wNXCYoerdLvtWUYo3jpj4 oJLHATuOQpRaB4TeuSgbnC2F/7lgCxnjZmYTt6O+dr4EeA73G3RBBanAWAUnuZ4tM20c A2SA== X-Gm-Message-State: AC+VfDy89fHzi6iEgHvYyeP/zC4Kk/sRUlJhririwrhbx2M2Oau8atSO m/J8W4IKF3oL+u/Kv/kgww== X-Google-Smtp-Source: ACHHUZ4siqcizt0yec2VxrzycsOYeYmD5d8wOVOWhGXKgd3y57FaiNdcOnjwkgE2TJ3rVzzGNHjgKA== X-Received: by 2002:a05:6a20:4421:b0:101:914e:da75 with SMTP id ce33-20020a056a20442100b00101914eda75mr31736423pzb.25.1684240893109; Tue, 16 May 2023 05:41:33 -0700 (PDT) Received: from Mac-mini.local ([39.171.215.147]) by smtp.gmail.com with ESMTPSA id q26-20020a62e11a000000b0063d29df1589sm13328669pfh.136.2023.05.16.05.41.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 May 2023 05:41:32 -0700 (PDT) Message-ID: <646379fc.620a0220.c0ae4.9fb2@mx.google.com> X-Google-Original-Message-ID: Received: by Mac-mini.local (Postfix, from userid 501) id D05AB8DDF129; Tue, 16 May 2023 20:41:08 +0800 (CST) References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <87sfbxhmxe.fsf@localhost> <64623c09.170a0220.52bf9.9437@mx.google.com> <87y1lo4ou1.fsf@localhost> User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Ihor Radchenko Cc: "Christopher M. Miles" , Org mode Subject: Re: [PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer Date: Tue, 16 May 2023 20:18:22 +0800 In-reply-to: <87y1lo4ou1.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=numbchild@gmail.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684240947; a=rsa-sha256; cv=none; b=prwv347J5m003xXp7IKcJWUnj+KOKgAxD4eH9EIZx/LsVDj7u0FOjClHhYx42oHI+iXK7T R0yXkcT033NE1dj/vTsmYHdUnLc7Rf4b7DsjEYVrwYpfgPisR6W+kVgM7kcHMm4gI4O4SR 2ITBg5QIHKK/vqX08AvMWFZLnhJtK2mUtJ4ldpcxK8ZWrNJpvQ3FiibbX23dX7GufNNnUe OTnEQky1yC6HUwRMjjZw3ilGtVuH+SwPrJCNf9F+iWjWOMIU4l4JQysRJnidf01qvSGnok i+L3xz1FJWbkGABKFt+2UkXSRPFxQyanDEd9q/YCiyqGpoRX4tZQTdOLdVMIxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=FsT2jgbg; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684240947; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xdTOKpp5aEq3t81h/K7EgCQpTh3nhWZluQ4pZDmDiTI=; b=fvctnuNI/25ehr7r6l2DA8xM7EPwRkbqLXGd7T4VI9l/wEIkN4AHrqvojiDUgLl78qT5vH VpezEIpL8LhjktOS5KVvwtAtYXiUqiwRM9lCJqagl6aj2IUt9Q0OASYEPwn9r11o72xNky QT3AzZ4fyj1y39iCEXoYjv9iJw1jnlt4XLRpvw+nBGDO0N/tf6FxgqjU9h/l7Bhoz7c57U NTIMy43T4jryMcTzxaGqPyB8o1gNS8ww27roXRWoyvHWLK14VLPCnlR3/8HpOgGik/b6iD FEbqNTUec3KHeJiWkm0NVDrjtxWvGzBx75//8pvi/G18x8za+mklahHpSDaW5g== X-Migadu-Spam-Score: -11.19 X-Spam-Score: -11.19 X-Migadu-Queue-Id: B711A1233C X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=FsT2jgbg; dmarc=pass (policy=none) header.from=gmail.com; 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-TUID: bphmVTX7Qh+W --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> I'd prefer something more closely resembling `org-latex-preview' >>> approach with prefix arguments: >>> ... >>> `org-toggle-inline-images' should also be changed. >> >> Here is the source code of `org-toggle-inline-images'. I implement this >> by reference `org-latex-preview'. I have not write testing, but only >> manually tested with Edebug and on actual Org buffer displaying and >> disable inline images. The command works fine. Ihor, can you review the = code? > > Unlike `org-latex-preview', here we need to (1) respect active region; > (2) keep the backward compatibility for INCLUDE-LINKED. > > For (1), for example, it would make sense to respect region when prefix > argument is C-u and clear images only there. For (2), we need to at > least allow toggling images with description using some prefix argument > (previously, any prefix argument would do). I indeed implemented all same behavior like `org-latex-preview' in new `org-toggle-inline-images'. For (1), org-latex-preview has a `cond' logic to toggle preview in region. Here is the code from `org-latex-preview'. ((use-region-p) (message "Creating LaTeX previews in region...") (org--latex-preview-region (region-beginning) (region-end)) (message "Creating LaTeX previews in region... done.")) + ;; Clear current section. ((equal arg '(4)) (org-clear-latex-preview (if (use-region-p) (region-beginning) (if (org-before-first-heading-p) (point-min) (save-excursion (org-with-limited-levels (org-back-to-heading t) (point))))) (if (use-region-p) (region-end) (org-with-limited-levels (org-entry-end-position))))) And I also implement the toggle inline images in region logic in `org-toggle-inline-images' as bellowing: ;; Display region selected inline images. ((use-region-p) (message "Displaying inline images in region...") (org-display-inline-images include-linked t (region-beginning) (region-= end)) (message "Displaying inline images in region... done.")) + ;; Clear current section. ((equal arg '(4)) (org-clear-latex-preview (if (use-region-p) (region-beginning) (if (org-before-first-heading-p) (point-min) (save-excursion (org-with-limited-levels (org-back-to-heading t) (point))))) (if (use-region-p) (region-end) (org-with-limited-levels (org-entry-end-position))))) =2D----------------------------------------------------------------------- For (2), It's working. The code passed the parameter `include-linked' to `org-display-inline-images'. So they works in any case of [C-u] prefix. Maybe you want to eval the patch code to test. =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRjeeQACgkQG13xyVro msPTUAgAnxC1+5sQrHWjy1AAw3OTBkb7w7uXKg4eAYg8OHWdTyMrWPhO/kDWB5V2 c/lMeQ8QFDIuZUhCWRANXFhHhPVEQl3RiPyxGFpmkFRjXKXbLCfjJoi0HXs/WeRx whLc1X4KJncV5R3FJIBY45t65DiQi0qbVcUVVTSwxhsmdaVq7Ki2bcGJ2kFiS+qd bp3GfrfPtWf5YCUXr4+ZpWlxWkxTQhJv0H8H1SkGSwpiJg8vX6Q7CRdn7qomVZ3+ onfC0USYsqosy5p8YyO/LKUbT5UnE1dGtg9egH+wjGnvs7VKCJHLAG2IVUKNPSfC 8i99lfGSluHtIdWh2im06T8gKhE9Zg== =RpZ0 -----END PGP SIGNATURE----- --=-=-=--