From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: lisp/lisp-mnt.el: lm-verify Date: Fri, 07 Dec 2007 23:03:52 +0100 Message-ID: <85ejdyjh6f.fsf@lola.goethe.zz> References: <85k5nqjkv4.fsf@lola.goethe.zz> <4759B7C8.5090706@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197065172 2335 80.91.229.12 (7 Dec 2007 22:06:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 22:06:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 07 23:06:16 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0lIz-0004si-5w for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 23:04:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0lIi-0000lk-4X for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 17:04:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0lIa-0000fP-WA for emacs-devel@gnu.org; Fri, 07 Dec 2007 17:03:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0lIa-0000e3-60 for emacs-devel@gnu.org; Fri, 07 Dec 2007 17:03:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0lIZ-0000dk-W7 for emacs-devel@gnu.org; Fri, 07 Dec 2007 17:03:56 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0lIZ-0008Sb-Cb for emacs-devel@gnu.org; Fri, 07 Dec 2007 17:03:55 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0lIY-0008Td-F8; Fri, 07 Dec 2007 17:03:54 -0500 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 9DB951C46130; Fri, 7 Dec 2007 23:03:52 +0100 (CET) In-Reply-To: <4759B7C8.5090706@gmail.com> (Lennart Borgman's message of "Fri, 07 Dec 2007 22:14:48 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84850 Archived-At: "Lennart Borgman (gmail)" 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