all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: lisp/lisp-mnt.el: lm-verify
Date: Fri, 07 Dec 2007 22:14:48 +0100	[thread overview]
Message-ID: <4759B7C8.5090706@gmail.com> (raw)
In-Reply-To: <85k5nqjkv4.fsf@lola.goethe.zz>

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))

  reply	other threads:[~2007-12-07 21:14 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) [this message]
2007-12-07 22:03   ` David Kastrup
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=4759B7C8.5090706@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.