emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mnt.el


From: Dave Love
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mnt.el
Date: Tue, 18 Dec 2001 11:30:26 -0500

Index: emacs/lisp/emacs-lisp/lisp-mnt.el
diff -c emacs/lisp/emacs-lisp/lisp-mnt.el:1.35 
emacs/lisp/emacs-lisp/lisp-mnt.el:1.36
*** emacs/lisp/emacs-lisp/lisp-mnt.el:1.35      Sun Dec  9 16:49:29 2001
--- emacs/lisp/emacs-lisp/lisp-mnt.el   Tue Dec 18 11:30:26 2001
***************
*** 128,133 ****
--- 128,136 ----
    :prefix "lm-"
    :group 'maint)
  
+ ;; At least some of these defcustoms should probably be defconsts,
+ ;; since they define, or are defined by, the header format.  -- fx
+ 
  (defcustom lm-header-prefix "^;+[ \t]+\\(@(#)\\)?[ \t]*\\$?"
    "Prefix that is ignored before the tag.
  For example, you can write the 1st line synopsis string and headers like this
***************
*** 142,149 ****
    :type 'regexp
    :group 'lisp-mnt)
  
! (defcustom lm-copyright-prefix "^;+[ \t]+Copyright (C) "
!   "Prefix that is ignored before the dates in a copyright."
    :type 'regexp
    :group 'lisp-mnt)
  
--- 145,153 ----
    :type 'regexp
    :group 'lisp-mnt)
  
! (defcustom lm-copyright-prefix "^\\(;+[ \t]\\)+Copyright (C) "
!   "Prefix that is ignored before the dates in a copyright.
! Leading comment characters and whitespace should be in regexp group 1."
    :type 'regexp
    :group 'lisp-mnt)
  
***************
*** 265,270 ****
--- 269,277 ----
  (put 'lm-with-file 'lisp-indent-function 1)
  (put 'lm-with-file 'edebug-form-spec t)
  
+ ;; Fixme: Probably this should be amalgamated with copyright.el; also
+ ;; we need a check for ranges in copyright years.
+ 
  (defun lm-crack-copyright (&optional file)
    "Return the copyright holder, and a list of copyright years.
  Use the current buffer if FILE is nil.
***************
*** 273,285 ****
      (goto-char (lm-copyright-mark))
      (let ((holder nil)
          (years nil)
          (end (line-end-position)))
!       (while (re-search-forward "\\([0-9]+\\),? +" end t)
!       (setq years (cons (match-string-no-properties 1) years)))
!       (if (looking-at ".*$")
!         (setq holder (match-string-no-properties 0)))
!       (cons holder (nreverse years))
!     )))
  
  (defun lm-summary (&optional file)
    "Return the one-line summary of file FILE, or current buffer if FILE is 
nil."
--- 280,312 ----
      (goto-char (lm-copyright-mark))
      (let ((holder nil)
          (years nil)
+         (start (point))
          (end (line-end-position)))
!       ;; Cope with multi-line copyright `lines'.  Assume the second
!       ;; line is indented (with the same commenting style).
!       (save-excursion
!       (beginning-of-line 2)
!       (let ((str (concat (match-string-no-properties 1) "[ \t]+")))
!         (beginning-of-line)
!         (while (looking-at str)
!           (setq end (line-end-position))
!           (beginning-of-line 2))))
!       ;; Make a single line and parse that.
!       (let ((buff (current-buffer)))
!       (with-temp-buffer
!         (insert-buffer-substring buff start end)
!         (goto-char (point-min))
!         (while (re-search-forward "^;+[ \t]+" nil t)
!           (replace-match ""))
!         (goto-char (point-min))
!         (while (re-search-forward " *\n" nil t)
!           (replace-match " "))
!         (goto-char (point-min))
!         (while (re-search-forward "\\([0-9]+\\),? +" nil t)
!           (setq years (cons (match-string-no-properties 1) years)))
!         (if (looking-at ".*$")
!             (setq holder (match-string-no-properties 0)))))
!       (cons holder (nreverse years)))))
  
  (defun lm-summary (&optional file)
    "Return the one-line summary of file FILE, or current buffer if FILE is 
nil."



reply via email to

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