emacs-devel
[Top][All Lists]
Advanced

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

Re: lisp/lisp-mnt.el: lm-verify


From: David Kastrup
Subject: Re: lisp/lisp-mnt.el: lm-verify
Date: Fri, 07 Dec 2007 23:03:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

"Lennart Borgman (gmail)" <address@hidden> writes:

> David Kastrup wrote:
>> After wracking my brain over the lm-verify code, I have come to the
>> conclusion that the code is utter garbage when a directory is passed in:
>> ret is set to a list (typically (nil nil nil nil)) rather than a string,
>> a temporary buffer gets filled with output but never gets displayed and
>> so on.
>>
>> It does not appear like any code in Emacs uses lm-verify, and there is
>> no autoload for it either.
>>
>> Anybody mind if I delete it rather than trying to figure out what
>> might have been intended?  Since there are no apparent callers...
>
> Maybe this will work better? :

Not really:

> (defun lm-verify (&optional file showok verbose non-fsf-ok)
>   "Check that the current buffer (or FILE if given) is in proper format.
> If FILE is a directory, recurse on its files and generate a report in a
> temporary buffer.  In that case, the optional argument SHOWOK
> says display \"OK\" in temp buffer for files that have no problems.
>
> Optional argument VERBOSE specifies verbosity level.
> Optional argument NON-FSF-OK if non-nil means a non-FSF
> copyright notice is allowed."
>   (interactive (list nil nil t))
>   (let* ((ret (and verbose "Ok"))
>          name)
>     (if (and file (file-directory-p file))
>         (setq ret
>               (with-temp-buffer
>                 (mapcar

Should be mapc, or rather a dolist construct.

>                  (lambda (f)
>                    (if (string-match ".*\\.el\\'" f)

Is true for lock files (dead symlinks) as well which makes lm-verify
fail.  Also does not actually "recurse" unless the directory is of name
"*.el".  The string match is unnecessarily slow because of the initial
.* and is unnecessary anyway since directory-files can take a pattern.
If there is a directory with name *.el, things get really weird.

The resulting message ends with \n and thus is not really pretty for
passing into message.  There also is a mixture of "Ok" and "OK"
depending on input flags.

>                        (let ((status (lm-verify f)))
>                          (insert f ":")
>                          (if status
>                              (lm-insert-at-column lm-comment-column status
>                                                   "\n")
>                            (if showok
>                                (lm-insert-at-column lm-comment-column
>                                                     "OK\n"))))))
>                  (directory-files file t))
>                 (buffer-string)))

[...]

In short: since this is not autoloaded and not used in this library
itself, I have a hard time picturing who would use it and for what
purpose.  Seems like bit rot to me from a time before checkdoc.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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