From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sH6rIJkPH2OhMgAAbAwnHQ (envelope-from ) for ; Mon, 12 Sep 2022 12:53:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yJbWH5kPH2Os9wAAG6o9tA (envelope-from ) for ; Mon, 12 Sep 2022 12:53:13 +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 3552438A49 for ; Mon, 12 Sep 2022 12:53:13 +0200 (CEST) Received: from localhost ([::1]:45684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXh3v-0003au-NQ for larch@yhetil.org; Mon, 12 Sep 2022 06:53:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXh23-0003Zl-RQ for emacs-orgmode@gnu.org; Mon, 12 Sep 2022 06:51:19 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:50739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXh20-00038d-3F for emacs-orgmode@gnu.org; Mon, 12 Sep 2022 06:51:14 -0400 Received: by mail-pj1-x1034.google.com with SMTP id fv3so7652798pjb.0 for ; Mon, 12 Sep 2022 03:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=8M4Zwq0hZieCkCd+tSO3T/EiVWKIAvcsGr5+T2Qw2VY=; b=K89lX/fyTrzTMJIrgh5g95tuqfwta2B3Y1PtD7FhKB2U2dek6Yqk2f3Mo7wix8/Lp3 xDWG1jln1BQSyvC1B9kUshjfR/zrDcbJOxH5OUL0uEAWpewwJ/vAN0VAjZaBq2VHlBEA gFaxGUvwanAwFDArL6YfLQxuq40qZtvWJAMxnxnKmb/KNeIEDltmM152UzislmFkFMUV c/RaCFOrd8DZQ9xEyPrdZBMlgcurAO2Jz2K3kQj85e56Vb+MsoVIDKleEtG8AXwiPI/l 8yFiWTBorWPyT/DOxWlTb0r9YVlsuawoFNNG/2nN2hhjsBX03QlW+P+Ck0fgUsShE4M/ NsRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=8M4Zwq0hZieCkCd+tSO3T/EiVWKIAvcsGr5+T2Qw2VY=; b=3qe148vpumjrer3teHW6K6oy1V3wMUooT6MnpL36dRapob0xlSdjS2QSJVi3oYfG6x mudMUD6Obt7BBij73ALU5hVzGlAK+ZA4r41Bpd/NNNie6H3nJJupJ7tRSiOnhsIVa3kd 8PhUMzDooef6H3ZLBp+ElUfKfm/hFUs6yh6eDLDunxOv4zL8fnDLWxMklsNefQq6bwJ1 ym2jUIe84ymn/Ka548oM5MVX4of4/ZDX5Qd5H0ewf32bAuvnQ0ySnna2uAX+gKylR/YI Du5KVtbSe7ml9E8xYo/zmoEqC+mwceopyufmIoU8hJxHsVaH3kp0VKT3psV95gmrs0oQ 8V5Q== X-Gm-Message-State: ACgBeo0gS29oZdVrqnivQHtgqnJeP+oGVZqi9uqpWPt6P8Rh7x73FuiQ wr1jPwG5o4/T9BPhOtnS+EQ= X-Google-Smtp-Source: AA6agR5DLKHQdkvCdryutMtioxNVXFltHE5lHhpRidPq0O+FftYM+F/ImnwngJjC00I+sCILQRqpHw== X-Received: by 2002:a17:903:22d1:b0:178:3d35:dfce with SMTP id y17-20020a17090322d100b001783d35dfcemr1090985plg.16.1662979869673; Mon, 12 Sep 2022 03:51:09 -0700 (PDT) Received: from localhost ([2409:8a70:2bc:c850:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id s8-20020a17090a880800b0020036e008bcsm5004412pjn.4.2022.09.12.03.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 03:51:08 -0700 (PDT) From: Ihor Radchenko To: "Christopher M. Miles" Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] New: auto display inline images under subtree when `org-cycle'. In-Reply-To: <631e92ee.050a0220.f9c18.92f5SMTPIN_ADDED_BROKEN@mx.google.com> References: <631d472b.c80a0220.2b4b2.bf86SMTPIN_ADDED_BROKEN@mx.google.com> <87h71ew0m0.fsf@localhost> <631e92ee.050a0220.f9c18.92f5SMTPIN_ADDED_BROKEN@mx.google.com> Date: Mon, 12 Sep 2022 18:51:55 +0800 Message-ID: <87y1uovp9w.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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: , 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=1662979993; 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=8M4Zwq0hZieCkCd+tSO3T/EiVWKIAvcsGr5+T2Qw2VY=; b=go+I/Yx+G9Q5mwRe/Mvnpub3/hTJRdXz+oNosK4pyZXIJ+rP5Pk9WfiIkmY+IICNKNQuO7 GPi6Cah85wss+4/jvi0ydrykBRpiZa5PshvLB1CbNiaai7FuGOwMzyhDia1Ipf6/bni2Ng EGnYZku4hGlqQdjeShx6jsGcnYKNcp2P9H1fG0CUNxlXWNOWQx2aWPzaFkizOLhULZZRAc tgiWz2jaGUC5M41y2o44BgkMEifeu+U9oFifZnrjtiAvJsavQHb+1D33ebRhxacl2u0lIF 16xfkX/T1VKU+6drlQwzD7SfiY39vVqBL+mdWOzaiu+N1ewB8jHiMPZoih+y3A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662979993; a=rsa-sha256; cv=none; b=lNjTOnQZWm9ZZybjrb61tuP9eh84XwftZfOysaKCrFa/ABwn46iKw53NtJOFKmbE3lfKvZ +MQohfiF/5ROveWHdrhJHSDAtrZRWmBLoI/1kfJEPQVEKnq+HCvlwZ7sMq3ZfCKUKRrFEL EKOLWlKFwxh5RXMINOzknCk4V+1o+V9+663CcZK5xoq/4oCMrjdVKaaaCnwzXIh1IENa8O 3DYPPxe8doum7qYW0uGqKlJhWPbmfRgrtNOSMyKnwsP27B744H+9yD0+kg4Xi1910Ic162 ti/2Toom674SS+m7a12HeghSHyJRckTdS1ol7640U2Im5jkJ2goE46UWreXU9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="K89lX/fy"; 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-Migadu-Spam-Score: -3.31 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="K89lX/fy"; 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-Migadu-Queue-Id: 3552438A49 X-Spam-Score: -3.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: xLmEJLGZyF2R "Christopher M. Miles" writes: > Ihor Radchenko writes: > >> "Christopher M. Miles" writes: >> >>>> When I put it on beginning of org document, then preview inline images, but those global attributes >>>> not affected. The inline images still display in actual image size. I want to specify image size >>>> under headline properties. Is it possible to do this? >>> >>> I implemented this feature by written a hook. Hope this can be helpful >>> for someone who also has this needs. Here is the code: >> >> This looks useful. >> Would you be interested to write a patch? > > The is the new patch which updated the defcustom variable docstring has correct description. Thanks for the patch! Before extending org-cycle functionality, let's first try to sort out subtree-level setting of the image size. In the patch, you are suggesting to use INLINE-IMAGE-WIDTH property. However, if we apply the patch as is, this property will only be useful when calling a single function - `org-display-subtree-with-inline-images'. It is not ideal. If we introduce subtree-level setting for inline image size, it should also work when displaying inline images by other existing means (org-toggle-inline-images). Instead of working around the existing code of `org-display-inline-images' and setting a custom `org-image-actual-width' variable in buffer, it is much better to change `org-display-inline-images' directly. At the end, the patch is not bound to your personal config - feel free to alter the existing Org functions. Similarly, you do not need to do (add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH") Simply change the default value of `org-default-properties'. Finally, it will be more consistent to name the property closer to the variable name: ORG-IMAGE-ACTUAL-WIDTH. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92