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 ms9.migadu.com with LMTPS id ltTMAqLEhWRxVwEASxT56A (envelope-from ) for ; Sun, 11 Jun 2023 14:57:06 +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 cKm4AKLEhWT0HwAAG6o9tA (envelope-from ) for ; Sun, 11 Jun 2023 14:57:06 +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 936492CEE1 for ; Sun, 11 Jun 2023 14:57:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8KcI-0002RV-B7; Sun, 11 Jun 2023 08:56:22 -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 1q8KcG-0002RN-Nm for emacs-orgmode@gnu.org; Sun, 11 Jun 2023 08:56:20 -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 1q8KcE-0005iB-Mo for emacs-orgmode@gnu.org; Sun, 11 Jun 2023 08:56:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E2F09240027 for ; Sun, 11 Jun 2023 14:56:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686488175; bh=UvJP8JxOcsIa0TZu3/TIKV6mOjUxc6dR5UDqZNR2q4s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=as9YjHVolXQ87bPwKKHPf+YFPn2V3bmX7h3XErvBwLt7ytsnz9m/pAX90pTcGQcbw NdRaCLCe90/mMXDhuDdqiMWNcc0KUxgg3YXyGswmYb5oP/O8/AOVkBhtaGAeHsnwfG 04N9+PlQC1yPvhdCnLorvXkWL0pMA9moWZpVPB1E5v5ZM8O6IiEVTdxDJYCJf61z6Q CyXPmUF+kKrkUwZ+NjhmUDHRDWivDOPq4Jy8PmqBWwiR6hvRBe8emJbE9yF6zg/8Kb z/1TBxDsEMD6NC2yM/MQkqu9nHvfDNav7yKQeDITaAd8sabU57Y1xPlYFpJfb4JUb8 WOl6TQoi/4C9g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QfFDv3F6Yz6tw4; Sun, 11 Jun 2023 14:56:15 +0200 (CEST) From: Ihor Radchenko To: Sebastian =?utf-8?Q?W=C3=A5linder?= Cc: emacs-orgmode@gnu.org Subject: Re: Babel results don't respect narrowing In-Reply-To: <87r0qib3ri.fsf@nixos.mail-host-address-is-not-set> References: <87mt2r39ru.fsf@nixos.mail-host-address-is-not-set> <87a5ykph0b.fsf@localhost> <87r0qib3ri.fsf@nixos.mail-host-address-is-not-set> Date: Sun, 11 Jun 2023 13:01:09 +0000 Message-ID: <87sfaynofe.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, RCVD_IN_DNSWL_MED=-2.3, 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686488225; a=rsa-sha256; cv=none; b=FISVWa3T7b1d7vXWFVcCW468Adg9qFlHzLMiLW2vb6lY1xeTpxsNMewBxXIn+T/GlW4pMY 7CsUonZYmk0ngilmC8/VaIFAfu5iI2TU4MkpTUHDcn6mmGzm4q77e0cvqq39AbH2aMIjA4 azhIX/bszta70pN9BRQJ3OahPGc2+anc/D3vAzJIRHOZza4efOwBtbObYf1qjK00ftWkNH 04Z5zISQ8VIp+kHJ7UaEoCZHL+J/r7/k/UeYyHluO3eDRUN9PMQOLvaoNK8Osbij0XDcWr c5WKqPeMV2cMLNk2vfVVZKoeH+nZK19AMWbw1mpRJLCCLkS/acICbtLtFxurfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=as9YjHVo; dmarc=pass (policy=none) header.from=posteo.net; 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=1686488225; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=UvJP8JxOcsIa0TZu3/TIKV6mOjUxc6dR5UDqZNR2q4s=; b=RP4qDrigP3UljO7unP43A1sU21ccNzAb0mcMfafDaNWt5MBX3om5Y8Ojy9Gbly3CZzVH8v xSsZSf7EFYWBNk6biMzbXN5F/J1XC/9UOn08Nu6JiHV4+6UoHS7f0leU+Rir8At1/l0kLc 4fgFX4zFd/LHykW6K1v5pQWh+p/0lsQm81UrXFmdum6gZAJDgko7tp0TcyLRWcp0mCnon1 4vET/RtAdHpuGhMUxVdPGqWm8PHsAHG/T9fvFUvSw1BmXjllH4JTiEzsU42Y9SXsu3qxGT zu3h+AvKkXIIgItxpvOAKoP90r9cHtTvzan9S+FFsOJ2vpNCKL4sU5GgXe0AGw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=as9YjHVo; dmarc=pass (policy=none) header.from=posteo.net; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -6.18 X-Spam-Score: -6.18 X-Migadu-Queue-Id: 936492CEE1 X-TUID: Lyt15fvGqFk1 [Adding Org ML back to CC] Sebastian W=C3=A5linder writes: >> May you elaborate about what kind of library you are referring to? >> Please describe the actual problem you ran into. > I'm using the AI API library `org-assistant` (https://github.com/tyler-do= dge/org-assistant). > The library uses org SRC blocks. When you execute a block, it adds an ID = tag to the org SRC result tag using the standard org SRC execute mechanism. > However, the library then searches for that ID in the buffer so that it c= an be replaced with the actual async output, but it doesn't search outside = the narrowing, and so can't find it. I'd say that org-assistant should disregard narrowing. AFAIU, org-assistant is using some kind of custom async processing (why not `org-babel-comint-async-register'?). If async processing is used, at the time when result is to be inserted, the user might set arbitrary narrowing in the buffer - it does not make sense to make things dependent on that custom narrowing. > This could be fixed in `org-assistant` itself, by disregarding the narrow= ing when searching for the ID, but I think it makes more sense to have org = blocks respect the narrowing when outputting results, as the narrowing is r= espected by most other commands. > > An advantage of respecting the narrowing when searching for the result ta= g is that the user can save old results from being overwritten by the next = execution of the SRC block by simply narrowing so that the result tag isn't= in view. Maybe. But it is too late. Honouring narrowing in `org-babel-where-is-src-block' will be a breaking change. At least, it is breaking a dozen of Org's own tests. The best I can do here is documenting the current behaviour in the docstring, to avoid confusion. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at