Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mnt.el @ 2528:df68ddbcc2f1
(lm-commentary-region): Gone.
(lm-commentary): New function.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Wed, 14 Apr 1993 03:34:42 +0000 |
parents | 8c8fe9da1f5e |
children | de0f38da99f5 |
comparison
equal
deleted
inserted
replaced
2527:93015b63b041 | 2528:df68ddbcc2f1 |
---|---|
3 ;; Copyright (C) 1992 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992 Free Software Foundation, Inc. |
4 | 4 |
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.3 1993/03/24 23:46:52 esr Exp $ | 8 ;; Version: $Id: lisp-mnt.el,v 1.2 1993/03/25 01:57:43 eric Exp eric $ |
9 ;; Keywords: docs | 9 ;; Keywords: docs |
10 ;; Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out! | 10 ;; Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out! |
11 | 11 |
12 ;; This file is part of GNU Emacs. | 12 ;; This file is part of GNU Emacs. |
13 | 13 |
115 (require 'picture) ; provides move-to-column-force | 115 (require 'picture) ; provides move-to-column-force |
116 (require 'emacsbug) | 116 (require 'emacsbug) |
117 | 117 |
118 ;; These functions all parse the headers of the current buffer | 118 ;; These functions all parse the headers of the current buffer |
119 | 119 |
120 (defun lm-section-mark (hd) | 120 (defun lm-section-mark (hd &optional after) |
121 ;; Return the buffer location of a given section start marker | 121 ;; Return the buffer location of a given section start marker |
122 (save-excursion | 122 (save-excursion |
123 (let ((case-fold-search t)) | 123 (let ((case-fold-search t)) |
124 (goto-char (point-min)) | 124 (goto-char (point-min)) |
125 (if (re-search-forward (concat "^;;; " hd ":$") nil t) | 125 (if (re-search-forward (concat "^;;; " hd ":$") nil t) |
126 (progn | 126 (progn |
127 (beginning-of-line) | 127 (beginning-of-line) |
128 (if after (forward-line 1)) | |
128 (point)) | 129 (point)) |
129 nil)))) | 130 nil)))) |
130 | 131 |
131 (defun lm-code-mark () | 132 (defun lm-code-mark () |
132 ;; Return the buffer location of the code start marker | 133 ;; Return the buffer location of the code start marker |
310 (lm-header "adapted-by") | 311 (lm-header "adapted-by") |
311 (if file | 312 (if file |
312 (kill-buffer (current-buffer))) | 313 (kill-buffer (current-buffer))) |
313 ))) | 314 ))) |
314 | 315 |
315 (defun lm-commentary-region (&optional file) | 316 (defun lm-commentary (&optional file) |
316 ;; Return a pair of character locations enclosing the commentary region. | 317 ;; Return the commentary region of a file, as a string." |
317 (save-excursion | 318 (save-excursion |
318 (if file | 319 (if file |
319 (find-file file)) | 320 (find-file file)) |
320 (prog1 | 321 (prog1 |
321 (let ((commentary (lm-section-mark "Commentary")) | 322 (let ((commentary (lm-section-mark "Commentary" t)) |
322 (change-log (lm-section-mark "Change Log")) | 323 (change-log (lm-section-mark "Change Log")) |
323 (code (lm-section-mark "Code"))) | 324 (code (lm-section-mark "Code"))) |
324 (if commentary | 325 (and commentary |
325 (if change-log | 326 (if change-log |
326 (cons commentary change-log) | 327 (buffer-substring commentary change-log) |
327 (cons commentary code))) | 328 (buffer-substring commentary code))) |
328 ) | 329 ) |
329 (if file | 330 (if file |
330 (kill-buffer (current-buffer))) | 331 (kill-buffer (current-buffer))) |
331 ))) | 332 ))) |
332 | 333 |