From unknown Sun Jun 22 11:38:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#64339 <64339@debbugs.gnu.org> To: bug#64339 <64339@debbugs.gnu.org> Subject: Status: 29.0.50; incorrect org-mode dynamic blocks docs Reply-To: bug#64339 <64339@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:38:21 +0000 retitle 64339 29.0.50; incorrect org-mode dynamic blocks docs reassign 64339 emacs submitter 64339 pva-outdoor@yandex.ru severity 64339 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 16:35:11 2023 Received: (at submit) by debbugs.gnu.org; 28 Jun 2023 20:35:11 +0000 Received: from localhost ([127.0.0.1]:51770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEbsd-0007Cw-1u for submit@debbugs.gnu.org; Wed, 28 Jun 2023 16:35:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:52536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEbsa-0007Cl-Ul for submit@debbugs.gnu.org; Wed, 28 Jun 2023 16:35:10 -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 1qEbsa-0007sE-4o for bug-gnu-emacs@gnu.org; Wed, 28 Jun 2023 16:35:08 -0400 Received: from forward100b.mail.yandex.net ([178.154.239.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEbsW-00066L-MC for bug-gnu-emacs@gnu.org; Wed, 28 Jun 2023 16:35:07 -0400 Received: from mail-nwsmtp-smtp-production-main-73.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-73.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:160b:0:640:acd0:0]) by forward100b.mail.yandex.net (Yandex) with ESMTP id 5BBBC60046 for ; Wed, 28 Jun 2023 23:34:56 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-73.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id lYTlVU2DgqM0-kaUJrsTy; Wed, 28 Jun 2023 23:34:56 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687984496; bh=td1yomrVMMLDbAC0H22jPuqA0UDCtHj38L1hmLnmJvw=; h=Message-ID:Date:Subject:To:From; b=RO8H3rvBfmIQ15foYSL1aelhPsvHXZIPH1Aoq/Fd/h416gdnFzuSdmBzD2gOCZLPf AdovvALLpYeVyIMCnZ3F0Hr7YtvUJOkS95IozgkwB6fx0JcDFoSGTJrjcfcfLZcfDm bmkP7ul7qyWjFYJsRBWBC1uFir3cbExzdKC8HqSg= Authentication-Results: mail-nwsmtp-smtp-production-main-73.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: pva-outdoor@yandex.ru To: bug-gnu-emacs@gnu.org Subject: 29.0.50; incorrect org-mode dynamic blocks docs Date: Thu, 29 Jun 2023 01:36:00 +0500 Message-ID: <87leg3pbnz.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=178.154.239.147; envelope-from=pva-outdoor@yandex.ru; helo=forward100b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, team! Please check the following documentation (or implementation) of org-mode dynamic blocks: 1. It seems that dynamic blocks can't have inner headlines (the org-dblock-write:xxx should not produce them). Otherwise the block will be parsed incorrectly (not mentioned in docs for org-mode). Example: Create the following 1.org and export it to unicode text (press C-c C-e t U). You will see "#+BEGIN: block2" as text. * Block2 =20=20 #+BEGIN: block2 ** Section 1 asdasdsad #+END: =20=20 2. Org-mode info file says: Dynamic blocks, like any other block, can be narrowed with =E2=80=98org-narrow-to-block=E2=80=99. That would not work because of implementation of org-narrow-to-block: (defun org-narrow-to-block () "Narrow buffer to the current block." (interactive) (let* ((case-fold-search t) (blockp (org-between-regexps-p "^[ \t]*#\\+begin_.*" <---- "^[ \t]*#\\+end_.*"))) (if blockp (narrow-to-region (car blockp) (cdr blockp)) (user-error "Not in a block")))) There is also a minor bug in org-mode (sould I report it in it's own mail?): If you press C-c C-, [RET] [RET] You'll get: #+begin_ #+end_nil while one could expect either begin_nil or end_.=20 In GNU Emacs 29.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, c= airo version 1.17.6) of 2022-07-15 built on pva-msi Repository revision: ed4ba79ea8f2be2d01f6447910e2c8319908d0d6 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Arch Linux Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB --=20 Best reqards, Andrey Petrov. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 00:58:34 2023 Received: (at 64339) by debbugs.gnu.org; 29 Jun 2023 04:58:34 +0000 Received: from localhost ([127.0.0.1]:52020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEjjl-0002yv-Ri for submit@debbugs.gnu.org; Thu, 29 Jun 2023 00:58:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEjjh-0002ye-Ny for 64339@debbugs.gnu.org; Thu, 29 Jun 2023 00:58:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEjjc-0002sq-8t; Thu, 29 Jun 2023 00:58:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=hv4ZcmeEbO+wMpvXHIQvdudFDTuHPlVWsKVZm7bT3vw=; b=O0gku/qKa6XqL6h5ZTz6 5wesyMJKm8k7gJKuMKjQhSdCkz8mFSDtpz8NnnmO0eXRuczphXHysNHTmwNR6CktFktaRgWmqo3E4 y956bOh63IxPK+Y99FzVxxkrJIUv8qLQ4yE90/VmEiB+kFKSQx6H1EfNMkR6/5eCMscGWEep1vyiL 559UOrJ2N1PXXKRMie98ls3qWac4FCKcyLvddg5HwjsyfzTmb+DLk1HzL/WXTYbsXdiJ6kltTXhHb 5rUOw1gfiaXPJvVz3YFz8VlvAfkL5bb2WQ9fxxcfwQ0RG7/cwOXEWUMrZ4XQZKQPwXEW1RMZ++/h7 fqZuF961zeCPlg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEjjb-0007jS-CG; Thu, 29 Jun 2023 00:58:23 -0400 Date: Thu, 29 Jun 2023 07:58:50 +0300 Message-Id: <83v8f6uanp.fsf@gnu.org> From: Eli Zaretskii To: pva-outdoor@yandex.ru In-Reply-To: <87leg3pbnz.fsf@yandex.ru> (pva-outdoor@yandex.ru) Subject: Re: bug#64339: 29.0.50; incorrect org-mode dynamic blocks docs References: <87leg3pbnz.fsf@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64339 Cc: 64339@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: pva-outdoor@yandex.ru > Date: Thu, 29 Jun 2023 01:36:00 +0500 > > Please check the following documentation (or implementation) of org-mode > dynamic blocks: > > 1. It seems that dynamic blocks can't have inner headlines (the > org-dblock-write:xxx should not produce them). Otherwise the block will > be parsed incorrectly (not mentioned in docs for org-mode). > > Example: Create the following 1.org and export it to unicode text (press > C-c C-e t U). You will see "#+BEGIN: block2" as text. > > * Block2 > > #+BEGIN: block2 > ** Section 1 > asdasdsad > #+END: > > 2. Org-mode info file says: > > Dynamic blocks, like any other block, can be narrowed with > ‘org-narrow-to-block’. > > That would not work because of implementation of org-narrow-to-block: > > (defun org-narrow-to-block () > "Narrow buffer to the current block." > (interactive) > (let* ((case-fold-search t) > (blockp (org-between-regexps-p "^[ \t]*#\\+begin_.*" <---- > "^[ \t]*#\\+end_.*"))) > (if blockp > (narrow-to-region (car blockp) (cdr blockp)) > (user-error "Not in a block")))) > > > > There is also a minor bug in org-mode (sould I report it > in it's own mail?): > > If you press C-c C-, [RET] [RET] You'll get: > > #+begin_ > #+end_nil > > while one could expect either begin_nil or end_. Could you please report this to the Org developers first? It sounds like a problem in Org or its documentation. Thanks.