annotate lisp/tl/texi-util.el @ 8:4b173ad71786 r19-15b5

Import from CVS: tag r19-15b5
author cvs
date Mon, 13 Aug 2007 08:47:35 +0200
parents b82b59fe008d
children 49a24b4fd526
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;; texi-util.el --- Texinfo utility
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1996 MORIOKA Tomohiko
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 4
diff changeset
6 ;; Version: $Id: texi-util.el,v 1.2 1996/12/22 00:29:31 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 ;; Keywords: Texinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 ;; This file is part of tl (Tiny Library).
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;; published by the Free Software Foundation; either version 2, or (at
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;; your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 ;; This program is distributed in the hope that it will be useful, but
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;; along with this program; see the file COPYING. If not, write to
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 (defun texinfo-all-menu-titles-update ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 (while (search-forward "\n@menu\n" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 (goto-char (match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 (while (looking-at "* \\([^:]+\\)::")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 (let ((title (buffer-substring (match-beginning 1)(match-end 1)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 (let ((ret
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 (re-search-forward
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (format
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 "@node %s.*\n@\\(chapter\\|\\(sub\\)*section\\) \\(.+\\)"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 (regexp-quote title)))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 (if ret
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 (let ((data (last (match-data) 2)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 (setq subj (buffer-substring (car data)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 (car (cdr data))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 (if subj
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 (or (string= subj title)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 (end-of-line)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 (insert subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 (end-of-line)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 (forward-char)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 (provide 'texi-util)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 ;;; texi-util.el ends here