]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/lisp-mnt.el
Add an option in Edebug to prevent pauses after `h', 'f', and `o'.
[gnu-emacs] / lisp / emacs-lisp / lisp-mnt.el
index f2e691102d4a752684ba343e2d4a770cfb0f994f..7d5b7dc749d6d7f01f9e3b0e35ce5813a109af35 100644 (file)
@@ -1,10 +1,10 @@
 ;;; lisp-mnt.el --- utility functions for Emacs Lisp maintainers
 
-;; Copyright (C) 1992, 1994, 1997, 2000-2013 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1997, 2000-2016 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Created: 14 Jul 1992
 ;; Keywords: docs
 ;; X-Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out!
 ;; ;;  Dave Brennan <brennan@hal.com>
 ;; ;;  Eric Raymond <esr@snark.thyrsus.com>
 ;;
-;; This field may have some special values; notably "FSF", meaning
-;; "Free Software Foundation".
-;;
 ;;    * Maintainer line --- should be a single name/address as in the Author
-;; line, or an address only, or the string "FSF".  If there is no maintainer
+;; line, or an address only.  If there is no maintainer
 ;; line, the person(s) in the Author field are presumed to be it.
 ;;    The idea behind these two fields is to be able to write a Lisp function
 ;; that does "send mail to the author" without having to mine the name out by
 ;; at a different version of the file than the one they're accustomed to.  This
 ;; may be an RCS or SCCS header.
 ;;
-;;    * Adapted-By line --- this is for FSF's internal use.  The person named
-;; in this field was the one responsible for installing and adapting the
-;; package for the distribution.  (This file doesn't have one because the
-;; author *is* one of the maintainers.)
+;;    * Adapted-By line --- this was used historically when some files
+;; were added to Emacs.  The person named in this field installed and
+;; (possibly adapted) the package in the Emacs distribution.
 ;;
 ;;    * Keywords line --- used by the finder code for finding Emacs
 ;; Lisp code related to a topic.
@@ -269,16 +265,17 @@ a section."
 
 (defun lm-header (header)
   "Return the contents of the header named HEADER."
-  (goto-char (point-min))
-  (let ((case-fold-search t))
-    (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
-              ;;   RCS ident likes format "$identifier: data$"
-              (looking-at
-               (if (save-excursion
-                     (skip-chars-backward "^$" (match-beginning 0))
-                     (= (point) (match-beginning 0)))
-                   "[^\n]+" "[^$\n]+")))
-      (match-string-no-properties 0))))
+  (save-excursion
+    (goto-char (point-min))
+    (let ((case-fold-search t))
+      (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
+                 ;;   RCS ident likes format "$identifier: data$"
+                 (looking-at
+                  (if (save-excursion
+                        (skip-chars-backward "^$" (match-beginning 0))
+                        (= (point) (match-beginning 0)))
+                      "[^\n]+" "[^$\n]+")))
+        (match-string-no-properties 0)))))
 
 (defun lm-header-multiline (header)
   "Return the contents of the header named HEADER, with continuation lines.
@@ -440,8 +437,10 @@ This can be found in an RCS or SCCS header."
           ;; Look for an SCCS header
           ((re-search-forward
             (concat
-             (regexp-quote "@(#)")
-             (regexp-quote (file-name-nondirectory (buffer-file-name)))
+             "@(#)"
+              (if buffer-file-name
+                  (regexp-quote (file-name-nondirectory buffer-file-name))
+                "[^\t\n]+")
              "\t\\([012345679.]*\\)")
             header-max t)
            (match-string-no-properties 1)))))))
@@ -461,8 +460,8 @@ each line."
   (let ((keywords (lm-keywords file)))
     (if keywords
        (if (string-match-p "," keywords)
-           (split-string keywords ",[ \t\n]*" t)
-         (split-string keywords "[ \t\n]+" t)))))
+           (split-string keywords ",[ \t\n]*" t "[ ]+")
+         (split-string keywords "[ \t\n]+" t "[ ]+")))))
 
 (defvar finder-known-keywords)
 (defun lm-keywords-finder-p (&optional file)
@@ -553,11 +552,11 @@ copyright notice is allowed."
               ((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")
+               "Can't find a `Commentary' section marker")
               ((not (lm-history-mark))
-               "Can't find a 'History' section marker")
+               "Can't find a `History' section marker")
               ((not (lm-code-mark))
-               "Can't find a 'Code' section marker")
+               "Can't find a `Code' section marker")
               ((progn
                  (goto-char (point-max))
                  (not