Mercurial > emacs
comparison lisp/emacs-lisp/copyright.el @ 611:10b56d2a2c2b
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 14 Apr 1992 22:02:55 +0000 |
parents | e7dd969ff98b |
children | fec3f9a1e3e5 |
comparison
equal
deleted
inserted
replaced
610:5f2f551fc367 | 611:10b56d2a2c2b |
---|---|
80 (delete-region (match-beginning 1) (match-end 1)) | 80 (delete-region (match-beginning 1) (match-end 1)) |
81 (insert ", ")) | 81 (insert ", ")) |
82 (insert current-year) | 82 (insert current-year) |
83 (message "Copyright updated to %s%s." | 83 (message "Copyright updated to %s%s." |
84 (if replace "" "include ") current-year) | 84 (if replace "" "include ") current-year) |
85 (if replace-copying-with | 85 (if replace-copying-with |
86 (let ((case-fold-search t) | 86 (let ((case-fold-search t) |
87 beg) | 87 beg) |
88 (goto-char (point-min)) | 88 (goto-char (point-min)) |
89 ;; Find the beginning of the copyright. | 89 ;; Find the beginning of the copyright. |
90 (if (search-forward "copyright" nil t) | 90 (if (search-forward "copyright" nil t) |
91 (progn | 91 (progn |
92 ;; Look for a blank line or a line | 92 ;; Look for a blank line or a line |
93 ;; containing only comment chars. | 93 ;; containing only comment chars. |
94 (if (re-search-forward "^\\(\\s \\s<\\|\\s>\\)*$" | 94 (if (re-search-forward "^\\(\\s \\s<\\|\\s>\\)*$" nil t) |
95 nil t) | 95 (forward-line 1) |
96 (forward-line 1) | 96 (with-output-to-temp-buffer "*Help*" |
97 (with-output-to-temp-buffer "*Help*" | 97 (princ (substitute-command-keys "\ |
98 (princ (substitute-command-keys "\ | |
99 I don't know where the copying notice begins. | 98 I don't know where the copying notice begins. |
100 Put point there and hit \\[exit-recursive-edit].")) | 99 Put point there and hit \\[exit-recursive-edit].")) |
101 (recursive-edit))) | 100 (recursive-edit))) |
102 (setq beg (point)) | 101 (setq beg (point)) |
103 (or (search-forward "02139, USA." nil t) | 102 (or (search-forward "02139, USA." nil t) |
104 (with-output-to-temp-buffer "*Help*" | 103 (with-output-to-temp-buffer "*Help*" |
105 (princ (substitute-command-keys "\ | 104 (princ (substitute-command-keys "\ |
106 I don't know where the copying notice ends. | 105 I don't know where the copying notice ends. |
107 Put point there and hit \\[exit-recursive-edit].")) | 106 Put point there and hit \\[exit-recursive-edit].")) |
108 (recursive-edit))) | 107 (recursive-edit))) |
109 (delete-region beg (point)))) | 108 (delete-region beg (point)))) |
110 (insert-file replace-copying-with)) | 109 (insert-file replace-copying-with)) |
111 (if (re-search-forward | 110 (if (re-search-forward |
112 "; either version \\(.+\\), or (at your option)" | 111 "; either version \\(.+\\), or (at your option)" |
113 nil t) | 112 nil t) |
114 (progn | 113 (progn |
115 (goto-char (match-beginning 1)) | 114 (goto-char (match-beginning 1)) |
116 (delete-region (point) (match-end 1)) | 115 (delete-region (point) (match-end 1)) |
117 (insert current-gpl-version))))) | 116 (insert current-gpl-version)))) |
118 (or ask-upd | 117 (or ask-upd |
119 (error "This buffer contains no copyright notice!"))))))) | 118 (error "This buffer contains no copyright notice!")))))))) |
120 | 119 |
121 ;;;###autoload | 120 ;;;###autoload |
122 (defun ask-to-update-copyright () | 121 (defun ask-to-update-copyright () |
123 "If the current buffer contains a copyright notice that is out of date, | 122 "If the current buffer contains a copyright notice that is out of date, |
124 ask the user if it should be updated with `update-copyright' (which see). | 123 ask the user if it should be updated with `update-copyright' (which see). |