diff options
| author | Richard M. Stallman | 1996-02-08 04:13:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-02-08 04:13:11 +0000 |
| commit | ca4bd734d235060a8a84e898f2aff9fa5feb903f (patch) | |
| tree | a63f26aff08a1dd8a11124be9c86983dca8c9bf0 | |
| parent | 79616aa086701ef37b20dd52211dcc1913591396 (diff) | |
| download | emacs-ca4bd734d235060a8a84e898f2aff9fa5feb903f.tar.gz emacs-ca4bd734d235060a8a84e898f2aff9fa5feb903f.zip | |
Change defconst into defvar. Many doc fixes.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mnt.el | 110 |
1 files changed, 53 insertions, 57 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 1b88718b07d..8a6af05993f 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> | 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> |
| 6 | ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com> | 6 | ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com> |
| 7 | ;; Created: 14 Jul 1992 | 7 | ;; Created: 14 Jul 1992 |
| 8 | ;; Version: $Id: lisp-mnt.el,v 1.14 1996/02/04 21:30:40 rms Exp rms $ | 8 | ;; Version: $Id: lisp-mnt.el,v 1.16 1996/02/06 21:35:20 erik Exp rms $ |
| 9 | ;; Keywords: docs | 9 | ;; Keywords: docs |
| 10 | ;; X-Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out! | 10 | ;; X-Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out! |
| 11 | 11 | ||
| @@ -70,7 +70,7 @@ | |||
| 70 | ;; line, or an address only, or the string "FSF". If there is no maintainer | 70 | ;; line, or an address only, or the string "FSF". If there is no maintainer |
| 71 | ;; line, the person(s) in the Author field are presumed to be it. The example | 71 | ;; line, the person(s) in the Author field are presumed to be it. The example |
| 72 | ;; in this file is mildly bogus because the maintainer line is redundant. | 72 | ;; in this file is mildly bogus because the maintainer line is redundant. |
| 73 | ;; The idea behind these two fields is to be able to write a lisp function | 73 | ;; The idea behind these two fields is to be able to write a Lisp function |
| 74 | ;; that does "send mail to the author" without having to mine the name out by | 74 | ;; that does "send mail to the author" without having to mine the name out by |
| 75 | ;; hand. Please be careful about surrounding the network address with <> if | 75 | ;; hand. Please be careful about surrounding the network address with <> if |
| 76 | ;; there's also a name in the field. | 76 | ;; there's also a name in the field. |
| @@ -95,7 +95,7 @@ | |||
| 95 | ;; for any real purpose; this is the way to safely add random headers | 95 | ;; for any real purpose; this is the way to safely add random headers |
| 96 | ;; without invoking the wrath of any program. | 96 | ;; without invoking the wrath of any program. |
| 97 | ;; | 97 | ;; |
| 98 | ;; * Commentary line --- enables lisp code to find the developer's and | 98 | ;; * Commentary line --- enables Lisp code to find the developer's and |
| 99 | ;; maintainers' explanations of the package internals. | 99 | ;; maintainers' explanations of the package internals. |
| 100 | ;; | 100 | ;; |
| 101 | ;; * Change log line --- optional, exists to terminate the commentary | 101 | ;; * Change log line --- optional, exists to terminate the commentary |
| @@ -119,10 +119,10 @@ | |||
| 119 | 119 | ||
| 120 | ;;; Variables: | 120 | ;;; Variables: |
| 121 | 121 | ||
| 122 | (defconst lm-header-prefix "^;;*[ \t]+\\(@\(#\)\\)?[ \t]*\\([\$]\\)?" | 122 | (defvar lm-header-prefix "^;;*[ \t]+\\(@\(#\)\\)?[ \t]*\\([\$]\\)?" |
| 123 | "Prefix that is ignored before the tag. | 123 | "Prefix that is ignored before the tag. |
| 124 | Eg. you can write the 1st line synopsis string and headers like this | 124 | For example, you can write the 1st line synopsis string and headers like this |
| 125 | in your lisp package: | 125 | in your Lisp package: |
| 126 | 126 | ||
| 127 | ;; @(#) package.el -- pacakge description | 127 | ;; @(#) package.el -- pacakge description |
| 128 | ;; | 128 | ;; |
| @@ -131,13 +131,13 @@ in your lisp package: | |||
| 131 | The @(#) construct is used by unix what(1) and | 131 | The @(#) construct is used by unix what(1) and |
| 132 | then $identifier: doc string $ is used by GNU ident(1)") | 132 | then $identifier: doc string $ is used by GNU ident(1)") |
| 133 | 133 | ||
| 134 | (defconst lm-comment-column 16 | 134 | (defvar lm-comment-column 16 |
| 135 | "Column used for placing formatted output.") | 135 | "Column used for placing formatted output.") |
| 136 | 136 | ||
| 137 | (defconst lm-commentary-header "Commentary\\|Documentation" | 137 | (defvar lm-commentary-header "Commentary\\|Documentation" |
| 138 | "Regexp which matches start of documentation section.") | 138 | "Regexp which matches start of documentation section.") |
| 139 | 139 | ||
| 140 | (defconst lm-history-header "Change Log\\|History" | 140 | (defvar lm-history-header "Change Log\\|History" |
| 141 | "Regexp which matches the start of code log section.") | 141 | "Regexp which matches the start of code log section.") |
| 142 | 142 | ||
| 143 | ;;; Functions: | 143 | ;;; Functions: |
| @@ -145,13 +145,13 @@ then $identifier: doc string $ is used by GNU ident(1)") | |||
| 145 | ;; These functions all parse the headers of the current buffer | 145 | ;; These functions all parse the headers of the current buffer |
| 146 | 146 | ||
| 147 | (defsubst lm-get-header-re (header &optional mode) | 147 | (defsubst lm-get-header-re (header &optional mode) |
| 148 | "Returns regexp for matching HEADER. If called with optional MODE and | 148 | "Returns regexp for matching HEADER. |
| 149 | with value 'section, return section regexp instead." | 149 | If called with optional MODE and with value `section', |
| 150 | (cond | 150 | return section regexp instead." |
| 151 | ((eq mode 'section) | 151 | (cond ((eq mode 'section) |
| 152 | (concat "^;;;;* " header ":[ \t]*$")) | 152 | (concat "^;;;;* " header ":[ \t]*$")) |
| 153 | (t | 153 | (t |
| 154 | (concat lm-header-prefix header ":[ \t]*")))) | 154 | (concat lm-header-prefix header ":[ \t]*")))) |
| 155 | 155 | ||
| 156 | (defsubst lm-get-package-name () | 156 | (defsubst lm-get-package-name () |
| 157 | "Returns package name by looking at the first line." | 157 | "Returns package name by looking at the first line." |
| @@ -166,8 +166,8 @@ with value 'section, return section regexp instead." | |||
| 166 | 166 | ||
| 167 | (defun lm-section-mark (header &optional after) | 167 | (defun lm-section-mark (header &optional after) |
| 168 | "Return the buffer location of a given section start marker. | 168 | "Return the buffer location of a given section start marker. |
| 169 | The HEADER is section mark string to find and AFTER is non-nil | 169 | The HEADER is the section mark string to search for. |
| 170 | returns location of next line." | 170 | If AFTER is non-nil, return the location of the next line." |
| 171 | (save-excursion | 171 | (save-excursion |
| 172 | (let ((case-fold-search t)) | 172 | (let ((case-fold-search t)) |
| 173 | (goto-char (point-min)) | 173 | (goto-char (point-min)) |
| @@ -179,30 +179,30 @@ returns location of next line." | |||
| 179 | nil)))) | 179 | nil)))) |
| 180 | 180 | ||
| 181 | (defsubst lm-code-mark () | 181 | (defsubst lm-code-mark () |
| 182 | "Return the buffer location of the 'Code' start marker." | 182 | "Return the buffer location of the `Code' start marker." |
| 183 | (lm-section-mark "Code")) | 183 | (lm-section-mark "Code")) |
| 184 | 184 | ||
| 185 | (defsubst lm-commentary-mark () | 185 | (defsubst lm-commentary-mark () |
| 186 | "Return the buffer location of the 'Commentary' start marker." | 186 | "Return the buffer location of the `Commentary' start marker." |
| 187 | (lm-section-mark lm-commentary-header)) | 187 | (lm-section-mark lm-commentary-header)) |
| 188 | 188 | ||
| 189 | (defsubst lm-history-mark () | 189 | (defsubst lm-history-mark () |
| 190 | "Return the buffer location of the 'history' start marker." | 190 | "Return the buffer location of the `History' start marker." |
| 191 | (lm-section-mark lm-history-header)) | 191 | (lm-section-mark lm-history-header)) |
| 192 | 192 | ||
| 193 | (defun lm-header (header) | 193 | (defun lm-header (header) |
| 194 | "Return the contents of a named HEADER." | 194 | "Return the contents of the header named HEADER." |
| 195 | (goto-char (point-min)) | 195 | (goto-char (point-min)) |
| 196 | (let ((case-fold-search t)) | 196 | (let ((case-fold-search t)) |
| 197 | (if (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t) | 197 | (if (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t) |
| 198 | ;; RCS ident likes format "$identifier: data$" | 198 | ;; RCS ident likes format "$identifier: data$" |
| 199 | (looking-at "\\([^$\n]+\\)") | 199 | (looking-at "\\([^$\n]+\\)") |
| 200 | (match-end 1)) | 200 | (match-end 1)) |
| 201 | (buffer-substring (match-beginning 1) (match-end 1)) | 201 | (buffer-substring (match-beginning 1) (match-end 1)) |
| 202 | nil))) | 202 | nil))) |
| 203 | 203 | ||
| 204 | (defun lm-header-multiline (header) | 204 | (defun lm-header-multiline (header) |
| 205 | "Return the contents of a named HEADER, with possible continuation lines. | 205 | "Return the contents of the header named HEADER, with continuation lines. |
| 206 | The returned value is a list of strings, one per line." | 206 | The returned value is a list of strings, one per line." |
| 207 | (save-excursion | 207 | (save-excursion |
| 208 | (goto-char (point-min)) | 208 | (goto-char (point-min)) |
| @@ -229,7 +229,7 @@ The returned value is a list of strings, one per line." | |||
| 229 | ;; These give us smart access to the header fields and commentary | 229 | ;; These give us smart access to the header fields and commentary |
| 230 | 230 | ||
| 231 | (defun lm-summary (&optional file) | 231 | (defun lm-summary (&optional file) |
| 232 | "Return the buffer's or optional FILE's one-line summary." | 232 | "Return the one-line summary of file FILE, or current buffer if FILE is nil." |
| 233 | (save-excursion | 233 | (save-excursion |
| 234 | (if file | 234 | (if file |
| 235 | (find-file file)) | 235 | (find-file file)) |
| @@ -245,9 +245,8 @@ The returned value is a list of strings, one per line." | |||
| 245 | ))) | 245 | ))) |
| 246 | 246 | ||
| 247 | (defun lm-crack-address (x) | 247 | (defun lm-crack-address (x) |
| 248 | "Cracks email address from string. | 248 | "Split up an email address into full name and real email address. |
| 249 | Given a string 'x' containing a human and email address, parse it | 249 | The value is a cons of the form (FULLNAME . ADDRESS)." |
| 250 | into a cons pair (NAME . ADDRESS)." | ||
| 251 | (cond ((string-match "\\(.+\\) [(<]\\(\\S-+@\\S-+\\)[>)]" x) | 250 | (cond ((string-match "\\(.+\\) [(<]\\(\\S-+@\\S-+\\)[>)]" x) |
| 252 | (cons (substring x (match-beginning 1) (match-end 1)) | 251 | (cons (substring x (match-beginning 1) (match-end 1)) |
| 253 | (substring x (match-beginning 2) (match-end 2)))) | 252 | (substring x (match-beginning 2) (match-end 2)))) |
| @@ -260,9 +259,9 @@ into a cons pair (NAME . ADDRESS)." | |||
| 260 | (cons x nil)))) | 259 | (cons x nil)))) |
| 261 | 260 | ||
| 262 | (defun lm-authors (&optional file) | 261 | (defun lm-authors (&optional file) |
| 263 | "Return the buffer's or optional FILE's author list. Each element of the | 262 | "Return the author list of file FILE, or current buffer if FILE is nil. |
| 264 | list is a cons; the car is a name-aming-humans, the cdr an email | 263 | Each element of the list is a cons; the car is the full name, |
| 265 | address." | 264 | the cdr is an email address." |
| 266 | (save-excursion | 265 | (save-excursion |
| 267 | (if file | 266 | (if file |
| 268 | (find-file file)) | 267 | (find-file file)) |
| @@ -274,9 +273,8 @@ address." | |||
| 274 | )))) | 273 | )))) |
| 275 | 274 | ||
| 276 | (defun lm-maintainer (&optional file) | 275 | (defun lm-maintainer (&optional file) |
| 277 | "Seearch for 'maintainer'. Get a package's bug-report & maintenance address. | 276 | "Return the maintainer of file FILE, or current buffer if FILE is nil. |
| 278 | Parse it out of FILE, or the current buffer if FILE is nil. | 277 | The return value has the form (NAME . ADDRESS)." |
| 279 | The return value is a (NAME . ADDRESS) cons." | ||
| 280 | (save-excursion | 278 | (save-excursion |
| 281 | (if file | 279 | (if file |
| 282 | (find-file file)) | 280 | (find-file file)) |
| @@ -290,8 +288,7 @@ The return value is a (NAME . ADDRESS) cons." | |||
| 290 | ))) | 288 | ))) |
| 291 | 289 | ||
| 292 | (defun lm-creation-date (&optional file) | 290 | (defun lm-creation-date (&optional file) |
| 293 | "Seearch for 'created'. Return a package's creation date, if any. | 291 | "Return the created date given in file FILE, or current buffer if FILE is nil." |
| 294 | Parse it out of FILE, or the current buffer if FILE is nil." | ||
| 295 | (save-excursion | 292 | (save-excursion |
| 296 | (if file | 293 | (if file |
| 297 | (find-file file)) | 294 | (find-file file)) |
| @@ -303,7 +300,7 @@ Parse it out of FILE, or the current buffer if FILE is nil." | |||
| 303 | 300 | ||
| 304 | 301 | ||
| 305 | (defun lm-last-modified-date (&optional file) | 302 | (defun lm-last-modified-date (&optional file) |
| 306 | "Return a package's last-modified date, if it has one." | 303 | "Return the modify-date given in file FILE, or current buffer if FILE is nil." |
| 307 | (save-excursion | 304 | (save-excursion |
| 308 | (if file | 305 | (if file |
| 309 | (find-file file)) | 306 | (find-file file)) |
| @@ -326,8 +323,8 @@ Parse it out of FILE, or the current buffer if FILE is nil." | |||
| 326 | ))) | 323 | ))) |
| 327 | 324 | ||
| 328 | (defun lm-version (&optional file) | 325 | (defun lm-version (&optional file) |
| 329 | "Search for RCS identifier '$Id'. Return the package's version field. | 326 | "Return the version listed in file FILE, or current buffer if FILE is nil. |
| 330 | If none, look for an RCS or SCCS header to crack it out of." | 327 | This can befound in an RCS or SCCS header to crack it out of." |
| 331 | (save-excursion | 328 | (save-excursion |
| 332 | (if file | 329 | (if file |
| 333 | (find-file file)) | 330 | (find-file file)) |
| @@ -356,8 +353,7 @@ If none, look for an RCS or SCCS header to crack it out of." | |||
| 356 | ))) | 353 | ))) |
| 357 | 354 | ||
| 358 | (defun lm-keywords (&optional file) | 355 | (defun lm-keywords (&optional file) |
| 359 | "Search for 'keywords'. Return the header containing the package's | 356 | "Return the keywords given in file FILE, or current buffer if FILE is nil." |
| 360 | topic keywords. Parse them out of FILE, or the current buffer if FILE is nil." | ||
| 361 | (save-excursion | 357 | (save-excursion |
| 362 | (if file | 358 | (if file |
| 363 | (find-file file)) | 359 | (find-file file)) |
| @@ -369,9 +365,9 @@ topic keywords. Parse them out of FILE, or the current buffer if FILE is nil." | |||
| 369 | ))) | 365 | ))) |
| 370 | 366 | ||
| 371 | (defun lm-adapted-by (&optional file) | 367 | (defun lm-adapted-by (&optional file) |
| 372 | "Search for 'adapted-by'. Return the name or code of the person who | 368 | "Return the adapted-by names in file FILE, or current buffer if FILE is nil. |
| 373 | cleaned up this package for distribution. Parse it out of FILE, or | 369 | This is the name of the person who cleaned up this package for |
| 374 | the current buffer if FILE is nil." | 370 | distribution." |
| 375 | (save-excursion | 371 | (save-excursion |
| 376 | (if file | 372 | (if file |
| 377 | (find-file file)) | 373 | (find-file file)) |
| @@ -382,9 +378,9 @@ the current buffer if FILE is nil." | |||
| 382 | ))) | 378 | ))) |
| 383 | 379 | ||
| 384 | (defun lm-commentary (&optional file) | 380 | (defun lm-commentary (&optional file) |
| 385 | "Return the commentary region of a file, as a string. | 381 | "Return the commentary in file FILE, or current buffer if FILE is nil. |
| 386 | The area is started with tag 'Commentary' and eded with tag | 382 | The value is returned as a string. In the text, the commentary starts |
| 387 | 'Change Log' or 'History'." | 383 | with tag `Commentary' and ends with tag `Change Log' or `History'." |
| 388 | (save-excursion | 384 | (save-excursion |
| 389 | (if file | 385 | (if file |
| 390 | (find-file file)) | 386 | (find-file file)) |
| @@ -414,7 +410,7 @@ The area is started with tag 'Commentary' and eded with tag | |||
| 414 | 410 | ||
| 415 | (defun lm-verify (&optional file showok &optional verb) | 411 | (defun lm-verify (&optional file showok &optional verb) |
| 416 | "Check that the current buffer (or FILE if given) is in proper format. | 412 | "Check that the current buffer (or FILE if given) is in proper format. |
| 417 | If FILE is a directory, recurse on its files and generate a report into | 413 | If FILE is a directory, recurse on its files and generate a report in |
| 418 | a temporary buffer." | 414 | a temporary buffer." |
| 419 | (interactive) | 415 | (interactive) |
| 420 | (let* ((verb (or verb (interactive-p))) | 416 | (let* ((verb (or verb (interactive-p))) |
| @@ -498,8 +494,8 @@ a temporary buffer." | |||
| 498 | 494 | ||
| 499 | (defun lm-synopsis (&optional file showall) | 495 | (defun lm-synopsis (&optional file showall) |
| 500 | "Generate a synopsis listing for the buffer or the given FILE if given. | 496 | "Generate a synopsis listing for the buffer or the given FILE if given. |
| 501 | If FILE is a directory, recurse on its files and generate a report into | 497 | If FILE is a directory, recurse on its files and generate a report in |
| 502 | a temporary buffer. If SHOWALL is on, also generate a line for files | 498 | a temporary buffer. If SHOWALL is non-nil, also generate a line for files |
| 503 | which do not include a recognizable synopsis." | 499 | which do not include a recognizable synopsis." |
| 504 | (interactive | 500 | (interactive |
| 505 | (list | 501 | (list |