From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 8MVuMLpVOmNtcwAAbAwnHQ (envelope-from ) for ; Mon, 03 Oct 2022 05:23:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mFWXL7pVOmN0twAAG6o9tA (envelope-from ) for ; Mon, 03 Oct 2022 05:23:38 +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 68C6510746 for ; Mon, 3 Oct 2022 05:23:38 +0200 (CEST) Received: from localhost ([::1]:40846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofC3M-0000Ln-TW for larch@yhetil.org; Sun, 02 Oct 2022 23:23:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofC0m-000582-C8 for emacs-orgmode@gnu.org; Sun, 02 Oct 2022 23:20:56 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:46706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofC0k-00083D-L3 for emacs-orgmode@gnu.org; Sun, 02 Oct 2022 23:20:56 -0400 Received: by mail-pg1-x532.google.com with SMTP id 78so8639619pgb.13 for ; Sun, 02 Oct 2022 20:20:54 -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=aSGeOyiWw/3FzPyMemneybvIvuQ37J8f/Ea2U5DebpY=; b=NYygKkHEgoZVJJ4ke0MketzgQDT1EN0phF/CYkXmyorZS26ZF/M4vn9DW0WRhX9qjy sSR7x3M6B8/cSOatoERqz7aO/pjQ15vV4owXRti18iabOKP2FjpmDGMKmOqQuPKaWM7u VO7fc9tHBTn76rTZYkGPZln1BcPkeYvP25PndHaNm8yFO66rV7IYycD/mP4n9qam2BF6 qJvS9YE84xcwNDsk8oYHbtJzZ14avsMh+6KGy0Nsu9bjQPdARV2RQTyRNz3gjpOv3fFD dat/HUitgSaXFbWH1HWpLVU1r9ohGjMoT6peB888SZuCNuJseHBH5tXeEzdissLlZRPm hmgg== 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=aSGeOyiWw/3FzPyMemneybvIvuQ37J8f/Ea2U5DebpY=; b=ZuwkIKzECoPb6nZDuvrl8316Qo8RA0PEn0yncuZPhTbnhkgXDB8ttThtU7XZk/CqaZ V4ubrxte9ROmNZ4vtTwfOkL1GQARuKQPZqdIFAqHVa2kHBB6FYYKL/Fssv/8h4RtydjA oOcDeIJxj+acuQ1sFjUtQbC7xA/PPM4Y9aUIKGCbcqU8gJY5t5KlgxpG1z5Kes84YZhb o8TnapBUvaaEeRW0/7PQDNQ0V4pnYN/4UNOOxI/P6wxwVQHws3KBNNOtlDz4OLpki8Jw AfD8luGgle/thiHvPz2rsxJmTtv12MtCDZm37DLkON8mzioljBBiSDij8weelPLMY0xi d4mQ== X-Gm-Message-State: ACrzQf2HBKySsCaTf/gKXKBzz69bVBeztLyjpNMakVG5fxE2ZdZPlai6 uSnArEk3GQq2b/EI+S2eUOY= X-Google-Smtp-Source: AMsMyM53NVgLDlKQC5xE7diZYQaBO7mFnHhwT5vNKin9sOTdQvCz6cDBNRBR93yIAsEEJkEfSAv/vA== X-Received: by 2002:a63:4a4b:0:b0:439:837:cc8d with SMTP id j11-20020a634a4b000000b004390837cc8dmr17361402pgl.199.1664767253213; Sun, 02 Oct 2022 20:20:53 -0700 (PDT) Received: from localhost ([1.83.154.214]) by smtp.gmail.com with ESMTPSA id a5-20020a1709027d8500b0017dd8c8009esm3456737plm.4.2022.10.02.20.20.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 20:20:52 -0700 (PDT) From: Ihor Radchenko To: "Christopher M. Miles" Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH 2-v3] New: auto display inline images under subtree when `org-cycle'. In-Reply-To: <63380f57.370a0220.a9d9a.dee8SMTPIN_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> <87y1uovp9w.fsf@localhost> <631fe1c9.050a0220.3ab2b.3f52SMTPIN_ADDED_BROKEN@mx.google.com> <87bkrhwc42.fsf@localhost> <6322b0a8.050a0220.59bb8.6923SMTPIN_ADDED_BROKEN@mx.google.com> <87y1uluir1.fsf@localhost> <6322f5ad.c80a0220.5e936.823eSMTPIN_ADDED_BROKEN@mx.google.com> <878rmesf64.fsf@localhost> <6329c8b0.050a0220.412d.0a6cSMTPIN_ADDED_BROKEN@mx.google.com> <87tu51xivh.fsf@localhost> <633454e3.050a0220.7278b.1fa5SMTPIN_ADDED_BROKEN@mx.google.com> <87y1u298yn.fsf@localhost> <63353c69.370a0220.67788.e8a1SMTPIN_ADDED_BROKEN@mx.google.com> <87o7ux4khz.fsf@localhost> <6336a955.050a0220.4e72e.2b23SMTPIN_ADDED_BROKEN@mx.google.com> <87bkqw2pzc.fsf@localhost> <63380f57.370a0220.a9d9a.dee8SMTPIN_ADDED_BROKEN@mx.google.com> Date: Mon, 03 Oct 2022 11:21:45 +0800 Message-ID: <878rlxzj5i.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=yantar92@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664767418; 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=aSGeOyiWw/3FzPyMemneybvIvuQ37J8f/Ea2U5DebpY=; b=NOvUMjdPFPZyawdr/UHd5qQPL/goP0rx7cxd5dG08ABXEsQaINY0RkTZ52G14e3TaRFL/3 AltIa9tQdltl0HKjnR7v/lcXQGSBso2fEflpJNpGPtLcLdoy+C2V0KnM+jh7ysBx07jrEU ckySija18bvLiA+x4a4XF7Drjyq/zQEpU60P8NRI+BEcwo6V8syt1/o048uJg08/o9wb4p 9+zZ7Qu6ANypyxk6avK5Kuhr0d4Cpy/idLztCXN60xd+BX79bwbTkV81Ag8hllRvo9qsfX c4odI8JLUCk9vSnZqgZDsWFApYFwMZUuwkiZFm0vLEqezjNCsVVAOHJshdfdRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664767418; a=rsa-sha256; cv=none; b=cSaRVyJgArZ4QhwL22x8m8hbFVFIxSsw8Gp85XumgykIVITQmVX1d3yzXRHFdC/wgel405 No+YQICjMRoSVKFiUMoUekJ9neEHHAEqbi69qajBM1STwa4UZtN46/3/WroGR/YZSKeAIN 0HNovgx/YTs68r5Hh8MaZYYrw7Unz3CxH2U+E4kG9LRfdCDWIUOlX0b6A65gQDYa8R1e8X QtZ3DZb9Hy7eSJ4CvyPEbg/sT6dhCUP9kVmW84McsMo1TWakWb/2hqoECxDjRAt/X0Tpvo cptM3Gr6tb2RVFFQOXhHPYCKEHCniECI218rlwp+3A7GbQGF5b3Z3Do7Ihz0RA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NYygKkHE; 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.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NYygKkHE; 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: 68C6510746 X-Spam-Score: -3.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: go/0Vrl98Uog "Christopher M. Miles" writes: > +*** New ~org-cycle-hook~ function ~org-cycle-display-inline-images~ for auto displaying subtree inline images > + > +This behavior is toggled by custom option ~org-cycle-inline-images-display~. > + I'd be a bit more direct. Something like "Outline cycling can now include inline image visibility". Also, it is a good idea to document the new feature in the manual (12.7 Images section and 2.2.1 Global and local cycling section). > + > + ;; `org-cycle' -(state)-> `'folded' remove inline image overlays. > + ;; (org-test-with-temp-text > + ;; (format "* Heading 1 > + ;; [[file:%s]] > + ;; ** Subheading 1 > + ;; [[file:%s]] > + ;; ** Subheading 2 > + ;; [[file:%s]]" org-logo-image org-logo-image org-logo-image) > + ;; (org-overview) > + ;; (org-cycle) > + ;; (org-cycle) > + ;; (org-cycle) > + ;; ;; TODO: how to detect inline image overlays are deleted after folded? > I commented out the third test if someone can do this. I don't now how to test in fold state. You can, for example, check org-inline-image-overlays and (overlays-in (point-min) (point-max)) > > Because I got error when running command "make test". I checked org-mode > source code repo, the ob-vala.el is removed, don't know where it is > introduced. I've seen this around the time we removed org-contrib. I suggest you to re-clone Org repo into a clean folder. > Started at: 2022-10-01 17:46:30+0800 > Finished. > Finished at: 2022-10-01 17:46:31+0800 > > F > > F test-org-fold/org-fold-display-inline-images > Test inline images displaying when cycling. > (ert-test-failed > ((should > (overlays-at > (point))) > :form > (overlays-at 130) > :value nil)) > #+end_example Please do not use org-cycle in tests. It is an interactive command and makes a number of assumptions about `this-command' and `last-command' values. Instead, prefer more direct `org-show-subtree'/`org-show-children'. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at