emacs-devel
[Top][All Lists]
Advanced

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

lisp-mnt patch


From: Eric M. Ludlam
Subject: lisp-mnt patch
Date: Wed, 31 Jan 2001 22:06:47 -0500

Dave Love asked me for this feature in checkdoc a long time ago.
This patches lisp-mnt to make sure a given file's keyword: section
includes keywords that are a part of finder.

lm-verify will also throw an error if there are no finder keywords.

Enjoy
Eric
-----------
Index: lisp-mnt.el
===================================================================
RCS file: /cvs/emacs/lisp/emacs-lisp/lisp-mnt.el,v
retrieving revision 1.30
diff -c -r1.30 lisp-mnt.el
*** lisp-mnt.el 2001/01/02 10:35:00     1.30
--- lisp-mnt.el 2001/02/01 03:02:37
***************
*** 370,375 ****
--- 370,392 ----
      (let ((keywords (lm-header "keywords")))
        (and keywords (downcase keywords)))))
  
+ (defun lm-keywords-list (&optional file)
+   "Return list of keywords given in file FILE."
+   (let ((keywords (lm-keywords file)))
+     (if keywords
+       (split-string keywords ",?[ \t]"))))
+ 
+ (defun lm-keywords-finder-p (&optional file)
+   "Return non-nil if any keywords in FILE are known to finder."
+   (require 'finder)
+   (let ((keys (lm-keywords-list file)))
+     (catch 'keyword-found
+       (while keys
+       (if (assoc (intern (car keys)) finder-known-keywords)
+           (throw 'keyword-found t))
+       (setq keys (cdr keys)))
+       nil)))
+ 
  (defun lm-adapted-by (&optional file)
    "Return the adapted-by names in file FILE, or current buffer if FILE is nil.
  This is the name of the person who cleaned up this package for
***************
*** 439,444 ****
--- 456,463 ----
                "Can't find a one-line 'Summary' description")
               ((not (lm-keywords))
                "Keywords: tag missing.")
+              ((not (lm-keywords-finder-p))
+               "Keywords: no valid finder keywords.")
               ((not (lm-commentary-mark))
                "Can't find a 'Commentary' section marker.")
               ((not (lm-history-mark))

-- 
          Eric Ludlam:                 address@hidden, address@hidden
   Home: www.ultranet.com/~zappo            Siege: www.siege-engine.com
Emacs: www.ultranet.com/~zappo/fsf.shtml          GNU: www.gnu.org



reply via email to

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