1 ;; -*- lexical-binding: t -*-
2 ;; Copyright (C) 2012 Free Software Foundation, Inc.
4 ;; Author: Christopher Schmidt <christopher@ch.ristopher.com>
5 ;; Maintainer: Christopher Schmidt <christopher@ch.ristopher.com>
7 ;; Compatibility: GNU Emacs: 24.x
9 ;; This file is part of ampc.
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;; I use this file to generate the formatted EmacsWiki description of ampc from
26 ;; the `Commentary' section in ampc.el.
33 (switch-to-buffer (get-buffer-create " *ampc EmacsWiki*"))
35 (delete-region (point-min) (point-max))
39 (find-lisp-object-file-name 'ampc (symbol-function 'ampc)))
40 (delete-region (point-min)
41 (progn (search-forward-regexp "^;;; \\*\\* installation")
42 (move-beginning-of-line nil)))
43 (delete-region (progn (search-forward-regexp "^;;; Code:\n")
45 (move-beginning-of-line nil)
48 (goto-char (point-min))
49 (replace-regexp "^;; ?" "")
50 (goto-char (point-min))
51 (replace-regexp "^; \\*\\* \\(.*\\)" "== \\1 ==\n")
52 (goto-char (point-min))
53 (replace-regexp "^; \\*\\*\\* \\(.*\\)" "=== \\1 ===\n")
54 (goto-char (point-min))
55 (replace-regexp "^\n\\(?1:\\((\\|\\.\\)\\(.*\n\\)+?\\)\n"
56 "\n<pre>\n\\1</pre>\n\n")
57 (goto-char (point-min))
58 (replace-regexp "ELPA" "[[ELPA]]")
59 (goto-char (point-min))
60 (replace-regexp "\\(this\\( \\|\n\\)file\\)" "\\1 (Lisp:ampc.el)")
61 (setf data (buffer-string)))
66 ;; indent-tabs-mode: nil