]>
code.delx.au - gnu-emacs-elpa/blob - packages/notes-mode/mkindex
5 # $Id: mkindex,v 1.9 2003/05/23 16:26:33 johnh Exp $
7 # Copyright (C) 1994-1996,2012 Free Software Foundation, Inc.
8 # Comments to <johnh@isi.edu>.
10 # This file is under the Gnu Public License.
15 usage: $0 <rawindex >index
17 Converts a raw index from a notes database into an index
18 suitable for notes-index-mode in emacs.
27 ($date, $subject) = m@
/(\d
{6})#\* (.*)$@;
28 warn("could not find date in rawindex line ``$_''.\n"), next if (!defined($date));
29 warn("could not find subject in rawindex line ``$_''.\n"), next if (!defined($subject));
30 $lcsubject = lc($subject);
31 $subject{$lcsubject} = $subject;
32 $list{$lcsubject} = "" if (!defined($list{$lcsubject})); # for -w
33 $list{$lcsubject} .= "$date, ";
36 print "# -*- mode: notes-index -*-\n";
37 foreach (sort keys %list) {
38 # Trim the trailing ", ".
40 print "$subject{$_}: $list{$_}\n";