unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master ddfba511c19 1/3: Check shortdoc keywords and fix one mistake
       [not found] ` <20240219171441.76EC3C3421F@vcs2.savannah.gnu.org>
@ 2024-02-19 18:59   ` Philip Kaludercic
  2024-02-19 19:21     ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Kaludercic @ 2024-02-19 18:59 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mattias Engdegård

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

This causes an error while compiling on my end:

emacs-lisp/shortdoc.el:138:2: Error: Symbol’s function definition is
void: shortdoc--check

This would fix it, but I don't know the details of what is going on:


[-- Attachment #2: Type: text/plain, Size: 1368 bytes --]

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index cde28985cd0..7597f601124 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -50,19 +50,19 @@ shortdoc-section
   '((t :inherit variable-pitch))
   "Face used for a section.")
 
-;;;###autoload
-(defun shortdoc--check (group functions)
-  (let ((keywords '( :no-manual :args :eval :no-eval :no-value :no-eval*
-                     :result :result-string :eg-result :eg-result-string :doc)))
-    (dolist (f functions)
-      (when (consp f)
-        (dolist (x f)
-          (when (and (keywordp x) (not (memq x keywords)))
-            (error "Shortdoc %s function `%s': bad keyword `%s'"
-                   group (car f) x)))))))
-
 ;;;###autoload
 (progn
+  (eval-and-compile
+    (defun shortdoc--check (group functions)
+      (let ((keywords '( :no-manual :args :eval :no-eval :no-value :no-eval*
+                         :result :result-string :eg-result :eg-result-string :doc)))
+        (dolist (f functions)
+          (when (consp f)
+            (dolist (x f)
+              (when (and (keywordp x) (not (memq x keywords)))
+                (error "Shortdoc %s function `%s': bad keyword `%s'"
+                       group (car f) x))))))))
+
   (defvar shortdoc--groups nil)
 
   (defmacro define-short-documentation-group (group &rest functions)

[-- Attachment #3: Type: text/plain, Size: 2204 bytes --]



Mattias Engdegård <mattiase@acm.org> writes:

> branch: master
> commit ddfba511c190e5bb44e44a50aef5ab8c08e3d798
> Author: Mattias Engdegård <mattiase@acm.org>
> Commit: Mattias Engdegård <mattiase@acm.org>
>
>     Check shortdoc keywords and fix one mistake
>     
>     * lisp/emacs-lisp/shortdoc.el (shortdoc--check)
>     (define-short-documentation-group): Check that used keywords exist.
>     * lisp/emacs-lisp/shortdoc.el (list): Fix a typo.
> ---
>  lisp/emacs-lisp/shortdoc.el | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
> index a6a49c72f74..cde28985cd0 100644
> --- a/lisp/emacs-lisp/shortdoc.el
> +++ b/lisp/emacs-lisp/shortdoc.el
> @@ -50,6 +50,17 @@
>    '((t :inherit variable-pitch))
>    "Face used for a section.")
>  
> +;;;###autoload
> +(defun shortdoc--check (group functions)
> +  (let ((keywords '( :no-manual :args :eval :no-eval :no-value :no-eval*
> +                     :result :result-string :eg-result :eg-result-string :doc)))
> +    (dolist (f functions)
> +      (when (consp f)
> +        (dolist (x f)
> +          (when (and (keywordp x) (not (memq x keywords)))
> +            (error "Shortdoc %s function `%s': bad keyword `%s'"
> +                   group (car f) x)))))))
> +
>  ;;;###autoload
>  (progn
>    (defvar shortdoc--groups nil)
> @@ -118,6 +129,7 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
>  `:no-eval*', `:result', `:result-string', `:eg-result' and
>  `:eg-result-string' properties."
>      (declare (indent defun))
> +    (shortdoc--check group functions)
>      `(progn
>         (setq shortdoc--groups (delq (assq ',group shortdoc--groups)
>                                      shortdoc--groups))
> @@ -715,7 +727,7 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
>     :eval (plist-get '(a 1 b 2 c 3) 'b))
>    (plist-put
>     :no-eval (setq plist (plist-put plist 'd 4))
> -   :eq-result (a 1 b 2 c 3 d 4))
> +   :eg-result (a 1 b 2 c 3 d 4))
>    (plist-member
>     :eval (plist-member '(a 1 b 2 c 3) 'b))
>    "Data About Lists"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: master ddfba511c19 1/3: Check shortdoc keywords and fix one mistake
  2024-02-19 18:59   ` master ddfba511c19 1/3: Check shortdoc keywords and fix one mistake Philip Kaludercic
@ 2024-02-19 19:21     ` Eli Zaretskii
  2024-02-19 19:25       ` Philip Kaludercic
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-02-19 19:21 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: emacs-devel, mattiase

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: Mattias Engdegård <mattiase@acm.org>
> Date: Mon, 19 Feb 2024 18:59:03 +0000
> 
> This causes an error while compiling on my end:
> 
> emacs-lisp/shortdoc.el:138:2: Error: Symbol’s function definition is
> void: shortdoc--check

How come? the function is defined before it is used.

> This would fix it, but I don't know the details of what is going on:

Very strange fix, to say the least.  We should definitely try
understanding better what's going on.  FTR, if I touch shortdoc.el and
rebuild Emacs, I see no errors or warnings.  As expected.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master ddfba511c19 1/3: Check shortdoc keywords and fix one mistake
  2024-02-19 19:21     ` Eli Zaretskii
@ 2024-02-19 19:25       ` Philip Kaludercic
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Kaludercic @ 2024-02-19 19:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, mattiase

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: Mattias Engdegård <mattiase@acm.org>
>> Date: Mon, 19 Feb 2024 18:59:03 +0000
>> 
>> This causes an error while compiling on my end:
>> 
>> emacs-lisp/shortdoc.el:138:2: Error: Symbol’s function definition is
>> void: shortdoc--check
>
> How come? the function is defined before it is used.

Apparently because it is being used in a macro.

>> This would fix it, but I don't know the details of what is going on:
>
> Very strange fix, to say the least.  We should definitely try
> understanding better what's going on.  FTR, if I touch shortdoc.el and
> rebuild Emacs, I see no errors or warnings.  As expected.

Apparently this works as well; I had tried to byte-compile the file
manually and I got the same error, so I assumed something more
complicated was happening.  So disregard this thread.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-19 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <170836288097.22729.10027592558614089561@vcs2.savannah.gnu.org>
     [not found] ` <20240219171441.76EC3C3421F@vcs2.savannah.gnu.org>
2024-02-19 18:59   ` master ddfba511c19 1/3: Check shortdoc keywords and fix one mistake Philip Kaludercic
2024-02-19 19:21     ` Eli Zaretskii
2024-02-19 19:25       ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).