From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: lisp/lisp-mnt.el: lm-verify Date: Fri, 07 Dec 2007 22:14:48 +0100 Message-ID: <4759B7C8.5090706@gmail.com> References: <85k5nqjkv4.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197062113 25234 80.91.229.12 (7 Dec 2007 21:15:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 21:15:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 07 22:15:22 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 1J0kXZ-0002ZM-EJ for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 22:15:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0kXI-0007aX-8E for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 16:15:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0kXE-0007Zm-7S for emacs-devel@gnu.org; Fri, 07 Dec 2007 16:15:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0kXC-0007YG-E8 for emacs-devel@gnu.org; Fri, 07 Dec 2007 16:14:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0kXC-0007Y5-2U for emacs-devel@gnu.org; Fri, 07 Dec 2007 16:14:58 -0500 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J0kX7-0007RX-Jh; Fri, 07 Dec 2007 16:14:54 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:61205 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1J0kX5-0002dp-7p; Fri, 07 Dec 2007 22:14:51 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <85k5nqjkv4.fsf@lola.goethe.zz> X-Antivirus: avast! (VPS 071206-0, 2007-12-06), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1J0kX5-0002dp-7p. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1J0kX5-0002dp-7p 70de97fd70680dff89cd8ad443c0d1a5 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:84849 Archived-At: 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? : (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 (lambda (f) (if (string-match ".*\\.el\\'" f) (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))) (lm-with-file file (setq name (lm-get-package-name)) (setq ret (cond ((null name) "Can't find package name") ((not (lm-authors)) "`Author:' tag missing") ((not (lm-maintainer)) "`Maintainer:' tag missing") ((not (lm-summary)) "Can't find the one-line summary description") ((not (lm-keywords)) "`Keywords:' tag missing") ((not (lm-keywords-finder-p)) "`Keywords:' has no valid finder keywords (see `finder-known-keywords')") ((not (lm-commentary-mark)) "Can't find a 'Commentary' section marker") ((not (lm-history-mark)) "Can't find a 'History' section marker") ((not (lm-code-mark)) "Can't find a 'Code' section marker") ((progn (goto-char (point-max)) (not (re-search-backward (concat "^;;;[ \t]+" name "[ \t]+ends here[ \t]*$" "\\|^;;;[ \t]+ End of file[ \t]+" name) nil t))) "Can't find the footer line") ((not (and (lm-copyright-mark) (lm-crack-copyright))) "Can't find a valid copyright notice") ((not (or non-fsf-ok (string-match "Free Software Foundation" (car (lm-crack-copyright))))) "Copyright holder is not the Free Software Foundation") (t ret))))) (if verbose (message ret)) ret))