GNU bug report logs - #64339
29.0.50; incorrect org-mode dynamic blocks docs

Previous Next

Package: emacs;

Reported by: pva-outdoor <at> yandex.ru

Date: Wed, 28 Jun 2023 20:36:02 UTC

Severity: normal

Found in version 29.0.50

To reply to this bug, email your comments to 64339 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64339; Package emacs. (Wed, 28 Jun 2023 20:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to pva-outdoor <at> yandex.ru:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 28 Jun 2023 20:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: pva-outdoor <at> yandex.ru
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; incorrect org-mode dynamic blocks docs
Date: Thu, 29 Jun 2023 01:36:00 +0500
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
  
  #+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_. 



In GNU Emacs 29.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo 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

-- 
Best reqards,
Andrey Petrov.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64339; Package emacs. (Thu, 29 Jun 2023 04:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 64339 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pva-outdoor <at> yandex.ru
Cc: 64339 <at> debbugs.gnu.org
Subject: Re: bug#64339: 29.0.50; incorrect org-mode dynamic blocks docs
Date: Thu, 29 Jun 2023 07:58:50 +0300
> From: pva-outdoor <at> 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.




This bug report was last modified 310 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.