From: David Kastrup <dak@gnu.org>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: lisp/lisp-mnt.el: lm-verify
Date: Fri, 07 Dec 2007 23:03:52 +0100 [thread overview]
Message-ID: <85ejdyjh6f.fsf@lola.goethe.zz> (raw)
In-Reply-To: <4759B7C8.5090706@gmail.com> (Lennart Borgman's message of "Fri, 07 Dec 2007 22:14:48 +0100")
"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> 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
next prev parent reply other threads:[~2007-12-07 22:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-07 20:44 lisp/lisp-mnt.el: lm-verify David Kastrup
2007-12-07 21:14 ` Lennart Borgman (gmail)
2007-12-07 22:03 ` David Kastrup [this message]
2007-12-07 22:20 ` Drew Adams
2007-12-07 22:21 ` Stefan Monnier
2007-12-07 22:43 ` David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85ejdyjh6f.fsf@lola.goethe.zz \
--to=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.