From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EMIpIplOZmXWAAAAG6o9tA:P1 (envelope-from ) for ; Tue, 28 Nov 2023 21:33:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EMIpIplOZmXWAAAAG6o9tA (envelope-from ) for ; Tue, 28 Nov 2023 21:33:29 +0100 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 4116743BFF for ; Tue, 28 Nov 2023 21:33:29 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=vodafonemail.de header.s=vfde-mb-mr2-23sep header.b=b71h5YDq; dmarc=pass (policy=quarantine) header.from=vodafonemail.de; 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=1701203609; 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=2gRPIuNtsEDMUuevcRT7KmHCvA++C54IGX98x1MkR9Y=; b=YO/rv7hQ8PSXSmzkyVVZqgYsJDU3bMR+9J9dcTDs9xjVId31Ord5qmOv+TLrtE0PfzVHD+ pndxyDT3L7l3kS8Z64H4tnpRtVnWqrCnnYgBnCFkqaqi6zSKloUGr5Uxuq5AlpjgLmWHIf 7XPHWIKkumYxkqgnF8y50D/N+oyoPq9QOWh0GCvYBOZnTayucLBDXaDezlxyUQHwCvg+gN gaQ4UvLifOYQ4IAAZZ0gptnOVA8LgSDBoqKdCAAsgeewBrehyeF5lK//7hyR+RYNbmEpOa w+EzVQTkMdx/8el/VvUg0b7GsHjdmvJEiJRYovTjTA2yg2e/3sBxbw5pnM2QaA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701203609; a=rsa-sha256; cv=none; b=PrhkKIr/1i9PwOYn5deUhO4E78Ep+iFt9ec1aAh/tlNbC+GkjoPo3ZZ5zqHeBp9sfXYHnc FBm5DDp+uRAR4yhi3GX8sBb2wKH27pDxwHy1kBlM10Q880dRX+R8CR3JMvbtNf4ORnThJp 3mt3B0ARZTBgTlkxwmufZmRvlelSfXPifOvm+rjGkP44XnyNInDA3ZQ8CrBmih4nYXEI7e nqSZ4umsS1+4JNRAcHs4nBPUP1GAoMMZQPtYcNZpSbXbIqGC0uF8zhbto6P5FXaT5rLOI9 pzV1ee5PoHYiQ6VbPakhUqaBrqi0YxCk7lNT3oNLddn1xhu5bVty4wjDCN7iXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=vodafonemail.de header.s=vfde-mb-mr2-23sep header.b=b71h5YDq; dmarc=pass (policy=quarantine) header.from=vodafonemail.de; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r84lJ-0002m0-Rm; Tue, 28 Nov 2023 15:32:54 -0500 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 1r84lH-0002lk-Mf for emacs-orgmode@gnu.org; Tue, 28 Nov 2023 15:32:51 -0500 Received: from mr6.vodafonemail.de ([145.253.228.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r84lE-0003yA-8r for emacs-orgmode@gnu.org; Tue, 28 Nov 2023 15:32:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1701203560; bh=2gRPIuNtsEDMUuevcRT7KmHCvA++C54IGX98x1MkR9Y=; h=Message-ID:Date:User-Agent:Subject:To:References:From: Content-Language:In-Reply-To:Content-Type:From; b=b71h5YDqiB9/6hEU6dVvtU6IH6EfcVqcOGGyjd7F8kIU+cVP9J0lYGXDjt5WmFvFI 0tg76Yn7le38+EnrQwsL9/TXPxnovtHU+K+uAjmJODWzj5uP8BIddHHaqYd2Xwr9MX pJkK3VYt4nFAnb1f6UCjMphNW/WFsnHecJqQtMOE= Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4SfvK40d6Bz1y42; Tue, 28 Nov 2023 20:32:40 +0000 (UTC) Received: from [192.168.178.41] (port-92-196-51-33.dynamic.as20676.net [92.196.51.33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4SfvJs5BRvzKm4D; Tue, 28 Nov 2023 20:32:26 +0000 (UTC) Message-ID: Date: Tue, 28 Nov 2023 21:32:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Bug] org-in-src-block-p returns t when not in source block To: Ihor Radchenko , No Wayman Cc: emacs-orgmode@gnu.org References: <87msuzdkcu.fsf@gmail.com> <874jh7uef4.fsf@localhost> From: Jens Schmidt Content-Language: de-DE-frami, en-US In-Reply-To: <874jh7uef4.fsf@localhost> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-type: clean X-purgate: clean X-purgate-size: 1517 X-purgate-ID: 155817::1701203555-77FFC099-7DE67C84/0/0 Received-SPF: pass client-ip=145.253.228.166; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr6.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, 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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -7.22 X-Spam-Score: -7.22 X-Migadu-Queue-Id: 4116743BFF X-TUID: 7egtJAWD/4UI On 2023-11-27 21:30, Ihor Radchenko wrote: > Fixed, on main. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6d7c7917a Which is currently my HEAD, and there are still edge cases that do not seem to be handled well. Start off from "make vanilla" and the following buffer ------------------------- test.org ------------------------- #+begin_src shell foo #+end_src bar ------------------------- test.org ------------------------- Navigate to BOL of the "#+end_src" line and M-: (org-in-src-block-p t) => nil As expected. Now add a space on the empty line *after* the "#+end_src" line, navigate back to BOL of the "#+end_src" line and M-: (org-in-src-block-p t) => t When I wrote my own inner-boundary function, I looked with envy at the elegance of the arithmetic done in `org-in-src-block-p' but thought that this probably would not always work ... or did I misunderstand something here? Thanks Jens Here is the lossage corresponding to my test case, just in case: C-s ;; isearch-forward # ;; isearch-printing-char + ;; isearch-printing-char e ;; isearch-printing-char n ;; isearch-printing-char d ;; isearch-printing-char C-a ;; org-beginning-of-line M-: (org-in-src-block-p t) ;; read--expression-try-read C-n ;; next-line SPC ;; org-self-insert-command C-a ;; org-beginning-of-line C-p ;; previous-line M-: (org-in-src-block-p t) ;; read--expression-try-read