view lispref/tindex.pl @ 66230:4344fd52a670

Add autoloads of crypt++ and mailcrypt routines, all for encryption functionality. allout customization subgroup now positioned in `outlines' group instead of prior `editing' group. (allout-encrypt-string, allout-encryption-produce-work-buffer) (allout-encrypted-topic-p, allout-encrypted-text-type) (allout-mc-activate-passwd, allout-create-encryption-key-verifier) (allout-situate-encryption-key-verifier) (allout-get-encryption-key-verifier, allout-verify-key) (allout-next-topic-pending-encryption) (allout-encrypt-decrypted, allout-encrypted-type-prefix): New functions. (outline-topic-encryption-bullet, outline-default-encryption-scheme) (outline-key-verifier-handling, outline-key-hint-handling) (outline-encrypt-unencrypted-on-saves): New defcustoms. (allout-file-key-verifier-string, allout-encryption-scheme) (allout-key-verifier-string, allout-key-hint-string) (allout-after-save-decrypt): New variables. (allout-write-file-hook-handler, allout-auto-save-hook-handler) (allout-after-saves-handler): New hook functions. (allout-post-command-business): Do allout-after-save-decrypt. (allout-enable-file-variable-adjustment): Custom var to enable mechanism for adding and adjusting settings of Emacs file variables. (allout-adjust-file-variable, allout-file-vars-section-data): New functions, implement the mechanism. (outlineify-sticky): Use the file vars mechanism. (allout-inhibit-protection, allout-during-write-cue) (allout-override-protect, allout-before-change-protect): Removed. (allout-flag-region, allout-open-topic): Revised to adjust read-only text. (allout-open-line-not-read-only): Added to facilitate read-only text based protection. (allout-kill-line): Revised to adjust read-only text, clue the user about the inhibition. (allout-unprotected): Robustified with an unwind-protect. (allout-shift-in, allout-shift-out): Disallow manually shifting a topic deeper than the offspring depth of the previous topic - avoiding confusing "containment discontinuities". (allout-reindent-bodies): Fixed retention of body relative hanging indent during promotion of collapsed bodies. (allout-open-topic): Made it easy to open new topic with same bullet as current topic - topic creation functions provided with any universal argument provokes now prompt for bullet, defaulting to the bullet of the previous topic. (allout-plain-bullets-string, allout-distinctive-bullets-string): Plain bullet alternates '.' period and ',' comma only. All other bullets are relegated to special status (but customizable). (allout-end-of-entry): Renamed from 'allout-end-of-current-entry since it actually operates w.r.t. most immediately containing entry, visible or not. (allout-hide-current-entry, allout-show-current-entry): Use the revised version. (allout-old-expose-topic): Solidify deprecation. (allout-end-of-subtree): Added, so we can span concealed as well as visible topics. (allout-end-of-current-subtree): Use `allout-end-of-subtree'. (allout-end-of-current-heading): Tweaked to just respect the first line. (allout-get-body-text): Added. (allout-ascend-to-depth, allout-ascend): Position at end of prefix when invoked interactively. (allout-up-current-level): Use `interactive-p'. (allout-mode, allout-init): Miscellaneous docstring and operational refinements, as well as hookups of new encryption stuff. (allout-beginning-of-current-entry): Now works as advertised. (allout-end-of-current-entry): Relieved of superfluous allout-show-entry. (allout-isearch-rectification): Refine condition for isearching (allout-isearch-abort, allout-enwrap-isearch). (allout-flag-region, my-region-active-p): Relocated some macros. (allout-title): Fallback title is '(buffer-name)', not non-existing '(current-buffer-name)'. (subst-char-in-string): Define if absent (for some XEmacs versions). Corrected commentary 'keywords' to legitimate ones. Updated comentary author info (using my current email address, obscurified).
author Eli Zaretskii <eliz@gnu.org>
date Thu, 20 Oct 2005 14:59:51 +0000
parents e836425ee789
children 067115a6e738 2d92f5c9d6ae
line wrap: on
line source

#! /usr/bin/perl

# Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

require 5;
use Getopt::Long;

my $USAGE = <<ENDUSAGE;
Remove \@tindex lines from files that were already present in previous
versions.

Usage: $0 [--old=EXT] FILE...
       $0 --help
       $0 --version

  --help	display this help and exit
  --version	print version and exit
  --old=DIR	find old files in DIR

The script performs two passes.  In the first pass, Texinfo files from
DIR are scanned for \@tindex lines, and identifiers in them are
recorded.  In a second pass, Texinfo files in the current directory
are scanned, and \@tindex lines for identifiers that were recorded in
the first pass are removed.  Old file contents are saved in files
with extension ".orig".  A list of modified files and removed \@tindex
identifiers is printed to stdout at the end.
ENDUSAGE

sub fatal {
    print STDERR "$0: ", @_, ".\n";
    exit 1;
}

my $help = 0;
my $version = 0;
my $old;

my $rc = GetOptions ('help' => \$help, 'version' => \$version,
                     'old=s' => \$old);
if ($version) {
    print "0.1\n";
    exit 0;
} elsif (!$rc || !$old || @ARGV) {
    print $USAGE;
    exit 1;
} elsif ($help) {
    print $USAGE;
    exit 0;
}

# Fill the hash %tindex with associations VAR -> COUNT where
# the keys VAR are identifiers mentioned in @tindex lines in the older
# files to process and COUNT is the number of times they are seen in
# the files.

my %tindex;
my %removed;
my @old_files = glob "$old/*.texi";
my @new_files = glob "*.texi";
fatal ("No Texinfo files found in `$old'") unless @old_files;
fatal ("No Texinfo files found in current directory") unless @new_files;

print "Scanning old files for \@tindex lines\n";
foreach $file (@old_files) {
    open (IN, "<$file") or fatal "Cannot open $file: $!";
    while (<IN>) {
	++$tindex{$1} if /^\s*\@tindex\s+(\S+)/;
    }
    close IN;
}

# Process current files and remove those @tindex lines which we
# know were already present in the files scanned above.

print "Removing old \@tindex lines\n";
foreach $file (@new_files) {
    my $modified = 0;
    my $contents = "";

    open (IN, "< $file") or fatal "Cannot open $file.orig for reading: $!";
    while (<IN>) {
	if (/^\s*\@tindex\s+(\S+)/ && $tindex{$1}) {
	    ++$removed{$1};
	    $modified = 1;
	} else {
	    $contents = $contents . $_;
	}
    }

    close IN;

    if ($modified) {
	print "  $file\n";
	system ("cp $file $file.orig") == 0 or fatal "Cannot backup $file: $!";
	open (OUT, ">$file") or fatal "Cannot open $file for writing: $!";
	print OUT $contents;
	close OUT;
    }
}

# Print a list of identifiers removed.

print "Removed \@tindex commands for:\n";
my $key;
foreach $key (keys %removed) {
    print "  $key\n";
}

# arch-tag: f8460df6-6bef-4c98-8555-e2c63a88b0fa