Subject: [PATCH] Bug: 15069: Correct functioning in the *scratch* buffer

From: pillule <[email-masked]>
Date: Fri, 21 May 2021 19:39:37 +0000

Hi,

Is that correct that it is a documentation bug (need to specify to 
the user to evaluate `count-words-in-defun' in eg, a *scratch* 
buffer) rather than an implementation bug (fixing the behavior of 
beginning-of-defun in Info-mode) ?

If so I attached a small patch there, and verified it after a 
`make docs`
>From 22e3722320bab1f8fbfef062afc0c7f889440c9a Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <[email-masked]>
Date: Fri, 21 May 2021 18:34:58 +0000
Subject: [PATCH] Clarify page 14.3 of eintr manual (bug#15069)

It has been pointed the instructions for `count-words-in-defun` are
ambiguous : One can expect to evaluate the sexp in the Info manual but
that would not work, so this commit explicit that it must be done in a
clean buffer (= with a valid syntaxe tree).

Copyright-paperwork-exempt: yes
---
 doc/lispintro/emacs-lisp-intro.texi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index fade4096e3..ba5fae4ff0 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -14650,7 +14650,8 @@ Let's re-use @kbd{C-c =} as a convenient keybinding:
 
 Now we can try out @code{count-words-defun}: install both
 @code{count-words-in-defun} and @code{count-words-defun}, and set the
-keybinding, and then place the cursor within the following definition:
+keybinding, and then place the cursor within the following definition,
+in a clean scratch buffer:
 
 @smallexample
 @group
-- 
2.20.1

I remember I especially liked to be able to evaluate sexp in place 
in the eintr manual, that is fitting so well the interpreted 
nature of elisp, but here the situation is out of my mind :
 - 1. the norm seems to *not* use the column 0 to declare top 
 level sexp in Info manuals even if 
 `open-paren-in-column-0-is-defun-start' is set to t.
 - 2. there is many opened sexp given as exemple, which will 
 confuse the syntaxe tree.

Have a nice day, or, night, I don't know.
--