emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master fd92023: Make checkdoc work with qualified methods


From: Stefan Monnier
Subject: Re: master fd92023: Make checkdoc work with qualified methods
Date: Fri, 05 Mar 2021 10:21:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>     (`(,(and
>          (or 'defun 'defvar 'defcustom 'defmacro 'defconst 'defsubst
>              'defadvice 'cl-defun 'cl-defgeneric 'cl-defmacro 'cl-defmethod)
>          def)
>        ,(pred symbolp)
>        ;; Require an initializer, i.e. ignore single-argument `defvar'
>        ;; forms, which never have a doc string.
>        ,_ . ,_)

I think you can reduce that to

    (pred symbolp)

and then check that (function-get def 'doc-string-elt) is non-nil.

> Note that I need to do (forward-sexp 1) so the requirements of
> cl--defmethod-doc-pos are fulfilled.  It may get messy if other defining
> forms declare a doc-string-elt function that assumes a different point
> position.

The starting position of `doc-string-elt` is currently defined de-facto
by the code in `lisp-string-in-doc-position-p`, so
`cl--defmethod-doc-pos` had no choice in the matter ;-)

> BTW, I've noticed that I forgot to add the Bug tag to my commit, I'm
> sorry.  This commit was part of Bug#46918.

I think this deserves a harsh punishment.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]