From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UKQxEQJgvmSqLQEASxT56A (envelope-from ) for ; Mon, 24 Jul 2023 13:26:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2DUjEAJgvmQf2wAAG6o9tA (envelope-from ) for ; Mon, 24 Jul 2023 13:26:58 +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 031233F659 for ; Mon, 24 Jul 2023 13:26:58 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XIHfEuf8; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690198018; h=from:from:sender:sender: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=sCoO79mEvshUF0gHH1UVJiTbV34BH3CvuH32P/UACaI=; b=D8LPByOjdUfg5LaMEFONE/asI9CtEW+jhOgxjJmpkrGLw2u7UDSk8tdB2jGNS8kjaKC98T vVPNhdmOvR64eFuU2atyvDK8OsKF76XvGrsrHGOspb89PNNrogHYbI5pIXVZQ7YJK1HokH OZLKrknntSk+Z4UAQ1drgkgQ7Gc3doKSQKPVKT6BGBBXRG6oVmXxuFyzSr/YLneIb+A16N ERwEPZqBidYTW+gtNu4COffSTrW7KUI/JUd6biVQ/cV/pDLAoc+zLBXf+VGTQngmL09q9p JXcqW2m4OxRFYjAB2Ll0yk3Kzy20xl4rMgrnsgpdY9SDJcsbZhYr3nUlx0aoYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690198018; a=rsa-sha256; cv=none; b=CYhd1msjhrXL7MueZOYpyhuKWOHc8YA+NQ/i2USwa2kc23GD+32Y4KfU24d11BZ72/ypme rdmHlPh2B+opaZBXePb5AOGRTpdoR3Ia8i0i+cTZV/3RdFtLyKoe+TuC6nQNN/PQJgdDCL vpqD86oHzS3WGHGcIrxS0zXhbLhi3H8hdR3hpFf5FhzRS9gHKnCYwZdicqWTEAi3YdUT+g gxIY5ifgSahWTi+OP0CEx4Es2PE/ar14NV5CWthIsOrjmFKVbl3/+AyDkZa1dKFpIsQojA AiBNe/DM1JB9Hq6uEh9EC+leSxrvjUpaJIUYM86AQoElxqezJkR15IjRigyjOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XIHfEuf8; 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"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNthJ-0006xT-IO; Mon, 24 Jul 2023 07:25:53 -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 1qNthH-0006x5-D4 for emacs-orgmode@gnu.org; Mon, 24 Jul 2023 07:25:51 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNthB-0001c0-IM for emacs-orgmode@gnu.org; Mon, 24 Jul 2023 07:25:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AD586240027 for ; Mon, 24 Jul 2023 13:25:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690197943; bh=TDjaJOpoWmnWUhup7H/ujOYHSgL9sIZEHAyobUbHcwE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=XIHfEuf8t4GQDVAUxD4gFyxShtL4ZBtq1ZScyxITHZQmX03ePTvMS7/GlkoKXhAo3 sxKADtpYbczVnggfLjW/5FH12GQKrHEB7afL5dsmWB/nscT52QF2OrBV7U7/72Y2eE Xcg1X0hwMSTE8CRmOWDZ0f5ra6ir1B2o59FHKodHs5vcz3CwgSj8Igy2g0X7jU/qcw FHWP4CPLGE6kRKy8e7Mm80Ff8b/wZH0rm1JuWNWZQgyPhTLNFJQiPArAHqNgEwr69V 09dp8GY5hUP74w6fboPf+WtpX80e6EZKGaLzx7O8CDJvmDoXHA6znQ/Tbf0oZhaYWv 187W4AE28bHYg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R8dBb002kz6tyY; Mon, 24 Jul 2023 13:25:42 +0200 (CEST) From: Ihor Radchenko To: "Christopher M. Miles" Cc: Org mode Subject: Re: [PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer In-Reply-To: <646379fc.620a0220.c0ae4.9fb2@mx.google.com> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <87sfbxhmxe.fsf@localhost> <64623c09.170a0220.52bf9.9437@mx.google.com> <87y1lo4ou1.fsf@localhost> <646379fc.620a0220.c0ae4.9fb2@mx.google.com> Date: Mon, 24 Jul 2023 11:25:56 +0000 Message-ID: <87zg3l1rgb.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=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: , 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 X-Migadu-Spam-Score: -4.83 X-Spam-Score: -4.83 X-Migadu-Queue-Id: 031233F659 X-Migadu-Scanner: mx1.migadu.com X-TUID: aVg3hXiYKtNv "Christopher M. Miles" writes: >> 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'. > > ... > 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.")) This is not a toggle. This is unconditional refresh. > 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. My concern is that previously C-u M-x org-toggle-inline-images would "display links with a text description part". With your patch, it is no longer the case because INCLUDE-LINKED is not affected by the prefix argument. And there is no clean way to allow INCLUDE-LINKED while keeping consistency with latex preview commands. What we might do here is making a new defcustom that will control whether linked images should be displayed. Then, something like C-1 org-toggle-inline-images could toggle that defcustom and refresh all the image previews in buffer (if any). WDYT? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at