summaryrefslogtreecommitdiff
path: root/texinfo/emacs
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-22 20:43:15 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-22 20:43:15 +0000
commit4416273ff4381b941f0b80be5469fc42801ecdd2 (patch)
tree4ef3666114905be6c619e972c6a78cc06a2f2d12 /texinfo/emacs
parentc4694df23695134e4bf060cecf84db6f35eec06b (diff)
downloadgcc-4416273ff4381b941f0b80be5469fc42801ecdd2.tar.gz
This commit was generated by cvs2svn to compensate for changes in r18765,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'texinfo/emacs')
-rw-r--r--texinfo/emacs/Makefile.in273
-rw-r--r--texinfo/emacs/info.el402
-rw-r--r--texinfo/emacs/informat.el131
-rw-r--r--texinfo/emacs/makeinfo.el17
-rw-r--r--texinfo/emacs/texinfmt.el98
-rw-r--r--texinfo/emacs/texinfo.el254
-rw-r--r--texinfo/emacs/texnfo-upd.el304
7 files changed, 888 insertions, 591 deletions
diff --git a/texinfo/emacs/Makefile.in b/texinfo/emacs/Makefile.in
index 5f19d1abea9..f200fa5934d 100644
--- a/texinfo/emacs/Makefile.in
+++ b/texinfo/emacs/Makefile.in
@@ -1,91 +1,204 @@
-# Makefile for Texinfo/emacs.
-# Copyright (C) 1995, 96 Free Software Foundation, Inc.
-# $Id: Makefile.in,v 1.1 1997/08/21 22:57:56 jason Exp $
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Author: Brian J. Fox (bfox@ai.mit.edu)
-#
+# Makefile.in generated automatically by automake 1.2 from Makefile.am
-srcdir = @srcdir@
-VPATH = @srcdir@
-SHELL = /bin/sh
-RM = rm -f
+# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+# Do not byte compile our Elisp files by default.
-ELISP_SRCS = info.el makeinfo.el texinfo.el texnfo-upd.el \
- texnfo-tex.el texinfmt.el informat.el detexinfo.el
-ELISP_OBJS = info.elc makeinfo.elc texinfo.elc texnfo-upd.elc \
- texnfo-tex.elc texinfmt.elc informat.elc detexinfo.elc
-.SUFFIXES: .el .elc
+SHELL = /bin/sh
-.el.elc:
- $(srcdir)/elisp-comp $<
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = true
+PRE_INSTALL = true
+POST_INSTALL = true
+NORMAL_UNINSTALL = true
+PRE_UNINSTALL = true
+POST_UNINSTALL = true
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+DATADIRNAME = @DATADIRNAME@
+EXEEXT = @EXEEXT@
+GENCAT = @GENCAT@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GT_NO = @GT_NO@
+GT_YES = @GT_YES@
+INSTOBJEXT = @INSTOBJEXT@
+INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+PACKAGE = @PACKAGE@
+POFILES = @POFILES@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+TERMLIBS = @TERMLIBS@
+TEXCONFIG = @TEXCONFIG@
+TEXMF = @TEXMF@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+l = @l@
+
+ELCFILES =
+
+# Do not install our Elisp files by default, either.
+noinst_LISP = info.el informat.el makeinfo.el \
+ texinfmt.el texinfo.el texnfo-upd.el
+
+EXTRA_DIST = README elisp-comp new-useful-setqs $(noinst_LISP)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+LISP = $(noinst_LISP)
+
+lispdir = @lispdir@
+EMACS = @EMACS@
+DIST_COMMON = README Makefile.am Makefile.in elisp-comp
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .el .elc
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus emacs/Makefile
-all:
-sub-all: all
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+.el.elc:
+ @echo 'WARNING: Warnings can be ignored. :-)'
+ if test $(EMACS) != no; then \
+ EMACS=$(EMACS) $(SHELL) $(srcdir)/elisp-comp $<; \
+ fi
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = emacs
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+info:
dvi:
+check: all
+ $(MAKE)
+installcheck:
install-info:
+install-exec:
+ @$(NORMAL_INSTALL)
+
+install-data: install-data-local
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall:
+
+all: Makefile $(LISP) $(ELCFILES)
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+
+
+mostlyclean-generic:
+ test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ rm -f Makefile $(DISTCLEANFILES)
+ rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-lisp mostlyclean-generic
+
+clean: clean-lisp clean-generic mostlyclean
+
+distclean: distclean-lisp distclean-generic clean
+ rm -f config.status
+
+maintainer-clean: maintainer-clean-lisp maintainer-clean-generic \
+ distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+.PHONY: default mostlyclean-lisp distclean-lisp clean-lisp \
+maintainer-clean-lisp tags distdir info dvi installcheck install-info \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+install-data-local:
+ @echo "WARNING: You must (compile and) install the Emacs Lisp files"
+ @echo "WARNING: manually. See ./emacs/README for some considerations."
-elisp: $(ELISP_OBJS)
-.PHONY: elisp
-
-# Nobody likes any of these install targets. Fine. Install it
-# manually, then.
-install:
- @echo Please install the Emacs Lisp files manually.
-
-uninstall:
- @echo Please uninstall the Emacs Lisp files manually.
-
-# install: $(ELISP_OBJS)
-# @(echo "(print (car load-path))" >/tmp/elc.$$$$; \
-# lispdir=`emacs -batch -q -l /tmp/elc.$$$$ -nw | grep site-lisp`; \
-# rm /tmp/elc.$$$$; \
-# if [ "$$lispdir" != "" ]; then \
-# lispdir=`echo $$lispdir | sed -e 's/"//g'`; \
-# echo "Installing .elc files in $$lispdir."; \
-# $(CP) $(ELISP_OBJS) $$lispdir; \
-# else \
-# echo "To install the elisp files, please copy *.elc to the"; \
-# echo "emacs site-lisp directory."; \
-# fi)
-#
-# install: $(ELISP_OBJS)
-# for file in $(ELISP_OBJS); do \
-# $(INSTALL_DATA) $$file $(lispdir); \
-# done
-#
-# uninstall: $(ELISP_OBJS)
-# cd $(lispdir) && rm -f $(ELISP_OBJS)
-#
-informat.elc: info.elc
-makeinfo.elc: texinfo.elc
-texinfmt.elc: texinfo.elc
-texinfmt.elc: texnfo-upd.elc
-
-Makefile: $(srcdir)/Makefile.in ../config.status
- cd .. && sh config.status
-
-realclean distclean: clean
- $(RM) Makefile *.log
-
-clean: FORCE
- $(RM) *.elc
-
-FORCE:
+# For some reason these do not get defined.
+distclean-lisp:
+clean-lisp:
+mostlyclean-lisp:
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/texinfo/emacs/info.el b/texinfo/emacs/info.el
index ead6ab92c98..ec21f5b9ff9 100644
--- a/texinfo/emacs/info.el
+++ b/texinfo/emacs/info.el
@@ -1,6 +1,7 @@
;;; info.el --- info package for Emacs.
-;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97 Free Software
+;; Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help
@@ -28,27 +29,39 @@
;;; Code:
+(defgroup info nil
+ "Info subsystem"
+ :group 'help
+ :group 'docs)
+
+
(defvar Info-history nil
"List of info nodes user has visited.
Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
-(defvar Info-enable-edit nil
+(defcustom Info-enable-edit nil
"*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
This is convenient if you want to write info files by hand.
However, we recommend that you not do this.
It is better to write a Texinfo file and generate the Info file from that,
-because that gives you a printed manual as well.")
+because that gives you a printed manual as well."
+ :type 'boolean
+ :group 'info)
(defvar Info-enable-active-nodes nil
"Non-nil allows Info to execute Lisp code associated with nodes.
The Lisp code is executed when the node is selected.")
(put 'Info-enable-active-nodes 'risky-local-variable t)
-(defvar Info-fontify t
- "*Non-nil enables highlighting and fonts in Info nodes.")
+(defcustom Info-fontify t
+ "*Non-nil enables highlighting and fonts in Info nodes."
+ :type 'boolean
+ :group 'info)
-(defvar Info-fontify-maximum-menu-size 30000
- "*Maximum size of menu to fontify if `Info-fontify' is non-nil.")
+(defcustom Info-fontify-maximum-menu-size 30000
+ "*Maximum size of menu to fontify if `Info-fontify' is non-nil."
+ :type 'integer
+ :group 'info)
(defvar Info-directory-list
(let ((path (getenv "INFOPATH"))
@@ -98,9 +111,11 @@ source tree, the `info' directory in the source tree is used as the last
element, in place of the installation Info directory. This is useful
when you run a version of Emacs without installing it.")
-(defvar Info-additional-directory-list nil
+(defcustom Info-additional-directory-list nil
"List of additional directories to search for Info documentation files.
-These directories are not searched for merging the `dir' file.")
+These directories are not searched for merging the `dir' file."
+ :type '(repeat directory)
+ :group 'info)
(defvar Info-current-file nil
"Info file that Info is now looking at, or nil.
@@ -114,10 +129,13 @@ or nil if current info file is not split into subfiles.")
(defvar Info-current-node nil
"Name of node that Info is now looking at, or nil.")
-(defvar Info-tag-table-marker (make-marker)
+(defvar Info-tag-table-marker nil
"Marker pointing at beginning of current Info file's tag table.
Marker points nowhere if file has no tag table.")
+(defvar Info-tag-table-buffer nil
+ "Buffer used for indirect tag tables.")
+
(defvar Info-current-file-completions nil
"Cached completion list for current Info file.")
@@ -133,16 +151,26 @@ Marker points nowhere if file has no tag table.")
(".z" . "gunzip")
(".inf" . nil)
("" . nil))
- '( (".info.Z" . "uncompress")
- (".info.Y" . "unyabba")
- (".info.gz" . "gunzip")
- (".info.z" . "gunzip")
- (".info" . nil)
- (".Z" . "uncompress")
- (".Y" . "unyabba")
- (".gz" . "gunzip")
- (".z" . "gunzip")
- ("" . nil)))
+ '( (".info.Z". "uncompress")
+ (".info.Y". "unyabba")
+ (".info.gz". "gunzip")
+ (".info.z". "gunzip")
+ (".info". nil)
+ ("-info.Z". "uncompress")
+ ("-info.Y". "unyabba")
+ ("-info.gz". "gunzip")
+ ("-info.z". "gunzip")
+ ("-info". nil)
+ ("/index.Z". "uncompress")
+ ("/index.Y". "unyabba")
+ ("/index.gz". "gunzip")
+ ("/index.z". "gunzip")
+ ("/index". nil)
+ (".Z". "uncompress")
+ (".Y". "unyabba")
+ (".gz". "gunzip")
+ (".z". "gunzip")
+ ("". nil)))
"List of file name suffixes and associated decoding commands.
Each entry should be (SUFFIX . STRING); the file is given to
the command as standard input. If STRING is nil, no decoding is done.
@@ -301,7 +329,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(cons (list Info-current-file Info-current-node (point))
Info-history)))
;; Go into info buffer.
- (switch-to-buffer "*info*")
+ (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
(buffer-disable-undo (current-buffer))
(or (eq major-mode 'Info-mode)
(Info-mode))
@@ -316,7 +344,6 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-current-file nil
Info-current-subfile nil
Info-current-file-completions nil
- Info-index-alternatives nil
buffer-file-name nil)
(erase-buffer)
(if (eq filename t)
@@ -325,12 +352,12 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq default-directory (file-name-directory filename)))
(set-buffer-modified-p nil)
;; See whether file has a tag table. Record the location if yes.
- (set-marker Info-tag-table-marker nil)
(goto-char (point-max))
(forward-line -8)
;; Use string-equal, not equal, to ignore text props.
- (or (string-equal nodename "*")
- (not (search-forward "\^_\nEnd tag table\n" nil t))
+ (if (not (or (string-equal nodename "*")
+ (not
+ (search-forward "\^_\nEnd tag table\n" nil t))))
(let (pos)
;; We have a tag table. Find its beginning.
;; Is this an indirect file?
@@ -341,16 +368,21 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(looking-at "(Indirect)\n"))
;; It is indirect. Copy it to another buffer
;; and record that the tag table is in that buffer.
- (save-excursion
- (let ((buf (current-buffer)))
- (set-buffer (get-buffer-create " *info tag table*"))
+ (let ((buf (current-buffer))
+ (tagbuf
+ (or Info-tag-table-buffer
+ (generate-new-buffer " *info tag table*"))))
+ (setq Info-tag-table-buffer tagbuf)
+ (save-excursion
+ (set-buffer tagbuf)
(buffer-disable-undo (current-buffer))
(setq case-fold-search t)
(erase-buffer)
- (insert-buffer-substring buf)
- (set-marker Info-tag-table-marker
- (match-end 0))))
- (set-marker Info-tag-table-marker pos))))
+ (insert-buffer-substring buf))
+ (set-marker Info-tag-table-marker
+ (match-end 0) tagbuf))
+ (set-marker Info-tag-table-marker pos)))
+ (set-marker Info-tag-table-marker nil))
(setq Info-current-file
(if (eq filename t) "dir" filename))))
;; Use string-equal, not equal, to ignore text props.
@@ -365,18 +397,28 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
;; read the proper subfile into this buffer.
(if (marker-position Info-tag-table-marker)
(save-excursion
- (set-buffer (marker-buffer Info-tag-table-marker))
- (goto-char Info-tag-table-marker)
- (if (re-search-forward regexp nil t)
- (progn
- (setq guesspos (read (current-buffer)))
- ;; If this is an indirect file,
- ;; determine which file really holds this node
- ;; and read it in.
- (if (not (eq (current-buffer) (get-buffer "*info*")))
- (setq guesspos
- (Info-read-subfile guesspos))))
- (error "No such node: %s" nodename))))
+ (let ((m Info-tag-table-marker)
+ found found-mode)
+ (save-excursion
+ (set-buffer (marker-buffer m))
+ (goto-char m)
+ (beginning-of-line) ;so re-search will work.
+ (setq found (re-search-forward regexp nil t))
+ (if found
+ (setq guesspos (read (current-buffer))))
+ (setq found-mode major-mode))
+ (if found
+ (progn
+ ;; If this is an indirect file, determine
+ ;; which file really holds this node and
+ ;; read it in.
+ (if (not (eq found-mode 'Info-mode))
+ ;; Note that the current buffer must be
+ ;; the *info* buffer on entry to
+ ;; Info-read-subfile. Thus the hackery
+ ;; above.
+ (setq guesspos (Info-read-subfile guesspos))))
+ (error "No such node: %s" nodename)))))
(goto-char (max (point-min) (- guesspos 1000)))
;; Now search from our advised position (or from beg of buffer)
;; to find the actual node.
@@ -464,7 +506,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
Info-dir-file-attributes
(cons (cons file attrs)
Info-dir-file-attributes))))))
- (or (cdr dirs) (setq Info-dir-contents-directory (car dirs)))
+ (or (cdr dirs) (setq Info-dir-contents-directory
+ (file-name-as-directory (car dirs))))
(setq dirs (cdr dirs))))
(or buffers
@@ -548,30 +591,39 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-dir-contents (buffer-string)))
(setq default-directory Info-dir-contents-directory))
+;; Note that on entry to this function the current-buffer must be the
+;; *info* buffer; not the info tags buffer.
(defun Info-read-subfile (nodepos)
- (set-buffer (marker-buffer Info-tag-table-marker))
- (goto-char (point-min))
- (search-forward "\n\^_")
+ ;; NODEPOS is either a position (in the Info file as a whole,
+ ;; not relative to a subfile) or the name of a subfile.
(let (lastfilepos
lastfilename)
- (forward-line 2)
- (catch 'foo
- (while (not (looking-at "\^_"))
- (if (not (eolp))
- (let ((beg (point))
- thisfilepos thisfilename)
- (search-forward ": ")
- (setq thisfilename (buffer-substring beg (- (point) 2)))
- (setq thisfilepos (read (current-buffer)))
- ;; read in version 19 stops at the end of number.
- ;; Advance to the next line.
- (forward-line 1)
- (if (> thisfilepos nodepos)
- (throw 'foo t))
- (setq lastfilename thisfilename)
- (setq lastfilepos thisfilepos))
- (forward-line 1))))
- (set-buffer (get-buffer "*info*"))
+ (if (numberp nodepos)
+ (save-excursion
+ (set-buffer (marker-buffer Info-tag-table-marker))
+ (goto-char (point-min))
+ (search-forward "\n\^_")
+ (forward-line 2)
+ (catch 'foo
+ (while (not (looking-at "\^_"))
+ (if (not (eolp))
+ (let ((beg (point))
+ thisfilepos thisfilename)
+ (search-forward ": ")
+ (setq thisfilename (buffer-substring beg (- (point) 2)))
+ (setq thisfilepos (read (current-buffer)))
+ ;; read in version 19 stops at the end of number.
+ ;; Advance to the next line.
+ (forward-line 1)
+ (if (> thisfilepos nodepos)
+ (throw 'foo t))
+ (setq lastfilename thisfilename)
+ (setq lastfilepos thisfilepos))
+ (forward-line 1)))))
+ (setq lastfilename nodepos)
+ (setq lastfilepos 0))
+ ;; Assume previous buffer is in Info-mode.
+ ;; (set-buffer (get-buffer "*info*"))
(or (equal Info-current-subfile lastfilename)
(let ((buffer-read-only nil))
(setq buffer-file-name nil)
@@ -582,7 +634,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-current-subfile lastfilename)))
(goto-char (point-min))
(search-forward "\n\^_")
- (+ (- nodepos lastfilepos) (point))))
+ (if (numberp nodepos)
+ (+ (- nodepos lastfilepos) (point)))))
;; Select the info node that point is in.
(defun Info-select-node ()
@@ -618,7 +671,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(defun Info-set-mode-line ()
(setq mode-line-buffer-identification
(concat
- "Info: ("
+ " Info: ("
(if Info-current-file
(file-name-nondirectory Info-current-file)
"")
@@ -667,7 +720,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(defun Info-read-node-name (prompt &optional default)
(let* ((completion-ignore-case t)
(completion-table (Info-build-node-completions))
- (nodename (completing-read prompt 'Info-read-node-name-1)))
+ (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))
(if (equal nodename "")
(or default
(Info-read-node-name prompt))
@@ -679,10 +732,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(save-excursion
(save-restriction
(if (marker-buffer Info-tag-table-marker)
- (progn
- (set-buffer (marker-buffer Info-tag-table-marker))
+ (let ((marker Info-tag-table-marker))
+ (set-buffer (marker-buffer marker))
(widen)
- (goto-char Info-tag-table-marker)
+ (goto-char marker)
(while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
(setq compl
(cons (list (buffer-substring (match-beginning 1)
@@ -727,6 +780,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(onode Info-current-node)
(ofile Info-current-file)
(opoint (point))
+ (ostart (window-start))
(osubfile Info-current-subfile))
(save-excursion
(save-restriction
@@ -739,27 +793,28 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(if (not found) ;can only happen in subfile case -- else would have erred
(unwind-protect
(let ((list ()))
- (set-buffer (marker-buffer Info-tag-table-marker))
- (goto-char (point-min))
- (search-forward "\n\^_\nIndirect:")
- (save-restriction
- (narrow-to-region (point)
- (progn (search-forward "\n\^_")
- (1- (point))))
+ (save-excursion
+ (set-buffer (marker-buffer Info-tag-table-marker))
(goto-char (point-min))
- (search-forward (concat "\n" osubfile ": "))
- (beginning-of-line)
- (while (not (eobp))
- (re-search-forward "\\(^.*\\): [0-9]+$")
- (goto-char (+ (match-end 1) 2))
- (setq list (cons (cons (read (current-buffer))
- (buffer-substring (match-beginning 1)
- (match-end 1)))
- list))
- (goto-char (1+ (match-end 0))))
- (setq list (nreverse list)
- current (car (car list))
- list (cdr list)))
+ (search-forward "\n\^_\nIndirect:")
+ (save-restriction
+ (narrow-to-region (point)
+ (progn (search-forward "\n\^_")
+ (1- (point))))
+ (goto-char (point-min))
+ (search-forward (concat "\n" osubfile ": "))
+ (beginning-of-line)
+ (while (not (eobp))
+ (re-search-forward "\\(^.*\\): [0-9]+$")
+ (goto-char (+ (match-end 1) 2))
+ (setq list (cons (cons (read (current-buffer))
+ (buffer-substring
+ (match-beginning 1) (match-end 1)))
+ list))
+ (goto-char (1+ (match-end 0))))
+ (setq list (nreverse list)
+ current (car (car list))
+ list (cdr list))))
(while list
(message "Searching subfile %s..." (cdr (car list)))
(Info-read-subfile (car (car list)))
@@ -771,9 +826,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(message "")
(signal 'search-failed (list regexp))))
(if (not found)
- (progn (Info-read-subfile opoint)
+ (progn (Info-read-subfile osubfile)
(goto-char opoint)
- (Info-select-node)))))
+ (Info-select-node)
+ (set-window-start (selected-window) ostart)))))
(widen)
(goto-char found)
(Info-select-node)
@@ -800,7 +856,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
;; Return the node name in the buffer following point.
;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
-;; saying which chas may appear in the node name.
+;; saying which chars may appear in the node name.
(defun Info-following-node-name (&optional allowedchars)
(skip-chars-forward " \t")
(buffer-substring-no-properties
@@ -884,9 +940,18 @@ NAME may be an abbreviation of the reference name."
;; Record as a completion and perhaps as default.
(if (eq default t) (setq default str))
(if (eq alt-default t) (setq alt-default str))
- (setq completions
- (cons (cons str nil)
- completions))))
+ ;; Don't add this string if it's a duplicate.
+ ;; We use a loop instead of "(assoc str completions)" because
+ ;; we want to do a case-insensitive compare.
+ (let ((tail completions)
+ (tem (downcase str)))
+ (while (and tail
+ (not (string-equal tem (downcase (car (car tail))))))
+ (setq tail (cdr tail)))
+ (or tail
+ (setq completions
+ (cons (cons str nil)
+ completions))))))
;; If no good default was found, try an alternate.
(or default
(setq default alt-default))
@@ -1148,8 +1213,7 @@ N is the digit argument used to invoke this command."
(interactive)
(if Info-standalone
(save-buffers-kill-emacs)
- (switch-to-buffer (prog1 (other-buffer (current-buffer))
- (bury-buffer (current-buffer))))))
+ (bury-buffer)))
(defun Info-next-menu-item ()
(interactive)
@@ -1222,9 +1286,15 @@ N is the digit argument used to invoke this command."
(defun Info-scroll-up ()
"Scroll one screenful forward in Info, considering all nodes as one sequence.
-Once you scroll far enough in a node that its menu appears on the screen,
-the next scroll moves into its first subnode. When you scroll past
-the end of a node, that goes to the next node or back up to the parent node."
+Once you scroll far enough in a node that its menu appears on the screen
+but after point, the next scroll moves into its first subnode.
+
+When you scroll past the end of a node, that goes to the next node; if
+this node has no successor, it moves to the parent node's successor,
+and so on. If point is inside the menu of a node, it moves to
+subnode indicated by the following menu item. (That case won't
+normally result from this command, but can happen in other ways.)"
+
(interactive)
(if (or (< (window-start) (point-min))
(> (window-start) (point-max)))
@@ -1363,7 +1433,7 @@ Give a blank topic name to go to the Index node itself."
"Go to the next matching index item from the last `i' command."
(interactive "p")
(or Info-index-alternatives
- (error "No previous `i' command in this file"))
+ (error "No previous `i' command"))
(while (< num 0)
(setq num (+ num (length Info-index-alternatives))))
(while (> num 0)
@@ -1446,7 +1516,16 @@ SIG optional fourth argument, controls action on no match
a string: signal an error, using that string."
(save-excursion
(goto-char pos)
- (re-search-backward start (max (point-min) (- pos 200)) 'yes)
+ ;; First look for a match for START that goes across POS.
+ (while (and (not (bobp)) (> (point) (- pos (length start)))
+ (not (looking-at start)))
+ (forward-char -1))
+ ;; If we did not find one, search back for START
+ ;; (this finds only matches that end at or before POS).
+ (or (looking-at start)
+ (progn
+ (goto-char pos)
+ (re-search-backward start (max (point-min) (- pos 200)) 'yes)))
(let (found)
(while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes)
(not (setq found (and (<= (match-beginning 0) pos)
@@ -1553,6 +1632,92 @@ If no reference to follow, moves to the next node, or up if none."
(define-key Info-mode-map "\177" 'Info-scroll-down)
(define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
)
+
+(defun Info-check-pointer (item)
+ ;; Non-nil if ITEM is present in this node.
+ (condition-case nil
+ (Info-extract-pointer item)
+ (error nil)))
+
+(easy-menu-define Info-mode-menu Info-mode-map
+ "Menu for info files."
+ '("Info"
+ ["Up" Info-up (Info-check-pointer "up")]
+ ["Next" Info-next (Info-check-pointer "next")]
+ ["Previous" Info-prev (Info-check-pointer "prev[ious]*")]
+ ("Menu item" ["You should never see this" report-emacs-bug t])
+ ("Reference" ["You should never see this" report-emacs-bug t])
+ ["Search..." Info-search t]
+ ["Goto node..." Info-goto-node t]
+ ["Last" Info-last Info-history]
+ ["Exit" Info-exit t]))
+
+(defvar Info-menu-last-node nil)
+;; Last node the menu was created for.
+
+(defun Info-menu-update ()
+ ;; Update the Info menu for the current node.
+ (condition-case nil
+ (if (or (not (eq major-mode 'Info-mode))
+ (eq Info-current-node Info-menu-last-node))
+ ()
+ ;; Update menu menu.
+ (let* ((Info-complete-menu-buffer (current-buffer))
+ (items (nreverse (condition-case nil
+ (Info-complete-menu-item
+ "" (lambda (e) t) t)
+ (error nil))))
+ entries current
+ (number 0))
+ (while (and items (< number 9))
+ (setq current (car items)
+ items (cdr items)
+ number (1+ number))
+ (setq entries (cons `[,current
+ (Info-menu ,current)
+ :keys ,(format "%d" number)]
+ entries)))
+ (if items
+ (setq entries (cons ["Other..." Info-menu t] entries)))
+ (or entries
+ (setq entries (list ["No menu" nil nil])))
+ (easy-menu-change '("Info") "Menu item" (nreverse entries)))
+ ;; Update reference menu. Code stolen from `Info-follow-reference'.
+ (let ((items nil)
+ str i entries current
+ (number 0))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "\\*note[ \n\t]*\\([^:]*\\):" nil t)
+ (setq str (buffer-substring
+ (match-beginning 1)
+ (1- (point))))
+ (setq i 0)
+ (while (setq i (string-match "[ \n\t]+" str i))
+ (setq str (concat (substring str 0 i) " "
+ (substring str (match-end 0))))
+ (setq i (1+ i)))
+ (setq items
+ (cons str items))))
+ (while (and items (< number 9))
+ (setq current (car items)
+ items (cdr items)
+ number (1+ number))
+ (setq entries (cons `[,current
+ (Info-follow-reference ,current)
+ t]
+ entries)))
+ (if items
+ (setq entries (cons ["Other..." Info-follow-reference t]
+ entries)))
+ (or entries
+ (setq entries (list ["No references" nil nil])))
+ (easy-menu-change '("Info") "Reference" (nreverse entries)))
+ ;; Update last seen node.
+ (setq Info-menu-last-node (current-buffer)))
+ ;; Try to avoid entering infinite beep mode in case of errors.
+ (error (ding))))
+
;; Info mode is suitable only for specially formatted data.
(put 'info-mode 'mode-class 'special)
@@ -1604,7 +1769,10 @@ Advanced commands:
(kill-all-local-variables)
(setq major-mode 'Info-mode)
(setq mode-name "Info")
+ (setq tab-width 8)
(use-local-map Info-mode-map)
+ (make-local-hook 'activate-menubar-hook)
+ (add-hook 'activate-menubar-hook 'Info-menu-update nil t)
(set-syntax-table text-mode-syntax-table)
(setq local-abbrev-table text-mode-abbrev-table)
(setq case-fold-search t)
@@ -1613,9 +1781,12 @@ Advanced commands:
(make-local-variable 'Info-current-subfile)
(make-local-variable 'Info-current-node)
(make-local-variable 'Info-tag-table-marker)
+ (setq Info-tag-table-marker (make-marker))
+ (make-local-variable 'Info-tag-table-buffer)
+ (setq Info-tag-table-buffer nil)
(make-local-variable 'Info-history)
(make-local-variable 'Info-index-alternatives)
- (if (memq (framep (selected-frame)) '(x pc))
+ (if (memq (framep (selected-frame)) '(x pc w32))
(progn
(make-face 'info-node)
(make-face 'info-menu-5)
@@ -1752,6 +1923,8 @@ the variable `Info-file-list-for-emacs'."
;; Get Info running, and pop to it in another window.
(save-window-excursion
(info))
+ ;; FIXME It would be cool if this could use a buffer other
+ ;; than *info*.
(pop-to-buffer "*info*")
(Info-find-node (car (car where))
(car (cdr (car where))))
@@ -1786,12 +1959,14 @@ the variable `Info-file-list-for-emacs'."
(t
(Info-goto-emacs-command-node command)))))
-(defvar Info-title-face-alist
+(defcustom Info-title-face-alist
'((?* bold underline)
(?= bold-italic underline)
(?- italic underline))
"*Alist of face or list of faces to use for pseudo-underlined titles.
-The alist key is the character the title is underlined with (?*, ?= or ?-).")
+The alist key is the character the title is underlined with (?*, ?= or ?-)."
+ :type '(repeat (list character face face))
+ :group 'info)
(defun Info-fontify-node ()
(save-excursion
@@ -1840,6 +2015,17 @@ The alist key is the character the title is underlined with (?*, ?= or ?-).")
(put-text-property (match-beginning 1) (match-end 1)
'mouse-face 'highlight))))
(set-buffer-modified-p nil))))
+
+
+;; When an Info buffer is killed, make sure the associated tags buffer
+;; is killed too.
+(defun Info-kill-buffer ()
+ (and (eq major-mode 'Info-mode)
+ Info-tag-table-buffer
+ (kill-buffer Info-tag-table-buffer)))
+
+(add-hook 'kill-buffer-hook 'Info-kill-buffer)
+
(provide 'info)
diff --git a/texinfo/emacs/informat.el b/texinfo/emacs/informat.el
index 0b195b9e620..36f0c560675 100644
--- a/texinfo/emacs/informat.el
+++ b/texinfo/emacs/informat.el
@@ -71,7 +71,8 @@
(delete-region (point) end)))
(goto-char (point-max))
(insert "\^_\f\nTag table:\n")
- (move-marker Info-tag-table-marker (point))
+ (if (eq major-mode 'info-mode)
+ (move-marker Info-tag-table-marker (point)))
(setq list (nreverse list))
(while list
(insert "Node: " (car (car list)) ?\177)
@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles."
(search-forward "\nTag Table:\n")
(insert "(Indirect)\n")))
+(defvar Info-validate-allnodes)
+(defvar Info-validate-thisnode)
+(defvar Info-validate-lossages)
+
;;;###autoload
(defun Info-validate ()
"Check current buffer for validity as an Info file.
@@ -165,76 +170,77 @@ Check that every node pointer points to an existing node."
(error "Don't yet know how to validate indirect info files: \"%s\""
(buffer-name (current-buffer))))
(goto-char (point-min))
- (let ((allnodes '(("*")))
+ (let ((Info-validate-allnodes '(("*")))
(regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
(case-fold-search t)
(tags-losing nil)
- (lossages ()))
+ (Info-validate-lossages ()))
(while (search-forward "\n\^_" nil t)
(forward-line 1)
(let ((beg (point)))
(forward-line 1)
(if (re-search-backward regexp beg t)
(let ((name (downcase
- (buffer-substring-no-properties
- (match-beginning 1)
- (progn
- (goto-char (match-end 1))
- (skip-chars-backward " \t")
- (point))))))
- (if (assoc name allnodes)
- (setq lossages
+ (buffer-substring-no-properties
+ (match-beginning 1)
+ (progn
+ (goto-char (match-end 1))
+ (skip-chars-backward " \t")
+ (point))))))
+ (if (assoc name Info-validate-allnodes)
+ (setq Info-validate-lossages
(cons (list name "Duplicate node-name" nil)
- lossages))
- (setq allnodes
- (cons (list name
- (progn
- (end-of-line)
- (and (re-search-backward
- "prev[ious]*:" beg t)
- (progn
- (goto-char (match-end 0))
- (downcase
- (Info-following-node-name)))))
- beg)
- allnodes)))))))
+ Info-validate-lossages))
+ (setq Info-validate-allnodes
+ (cons (list name
+ (progn
+ (end-of-line)
+ (and (re-search-backward
+ "prev[ious]*:" beg t)
+ (progn
+ (goto-char (match-end 0))
+ (downcase
+ (Info-following-node-name)))))
+ beg)
+ Info-validate-allnodes)))))))
(goto-char (point-min))
(while (search-forward "\n\^_" nil t)
(forward-line 1)
(let ((beg (point))
- thisnode next)
+ Info-validate-thisnode next)
(forward-line 1)
(if (re-search-backward regexp beg t)
(save-restriction
(search-forward "\n\^_" nil 'move)
(narrow-to-region beg (point))
- (setq thisnode (downcase
- (buffer-substring-no-properties
- (match-beginning 1)
- (progn
- (goto-char (match-end 1))
- (skip-chars-backward " \t")
- (point)))))
+ (setq Info-validate-thisnode (downcase
+ (buffer-substring-no-properties
+ (match-beginning 1)
+ (progn
+ (goto-char (match-end 1))
+ (skip-chars-backward " \t")
+ (point)))))
(end-of-line)
(and (search-backward "next:" nil t)
(setq next (Info-validate-node-name "invalid Next"))
- (assoc next allnodes)
- (if (equal (car (cdr (assoc next allnodes)))
- thisnode)
+ (assoc next Info-validate-allnodes)
+ (if (equal (car (cdr (assoc next Info-validate-allnodes)))
+ Info-validate-thisnode)
;; allow multiple `next' pointers to one node
- (let ((tem lossages))
+ (let ((tem Info-validate-lossages))
(while tem
(if (and (equal (car (cdr (car tem)))
"should have Previous")
(equal (car (car tem))
next))
- (setq lossages (delq (car tem) lossages)))
+ (setq Info-validate-lossages
+ (delq (car tem) Info-validate-lossages)))
(setq tem (cdr tem))))
- (setq lossages
+ (setq Info-validate-lossages
(cons (list next
"should have Previous"
- thisnode)
- lossages))))
+ Info-validate-thisnode)
+ Info-validate-lossages))))
(end-of-line)
(if (re-search-backward "prev[ious]*:" nil t)
(Info-validate-node-name "invalid Previous"))
@@ -244,12 +250,12 @@ Check that every node pointer points to an existing node."
(if (re-search-forward "\n* Menu:" nil t)
(while (re-search-forward "\n\\* " nil t)
(Info-validate-node-name
- (concat "invalid menu item "
- (buffer-substring (point)
- (save-excursion
- (skip-chars-forward "^:")
- (point))))
- (Info-extract-menu-node-name))))
+ (concat "invalid menu item "
+ (buffer-substring (point)
+ (save-excursion
+ (skip-chars-forward "^:")
+ (point))))
+ (Info-extract-menu-node-name))))
(goto-char (point-min))
(while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t)
(goto-char (+ (match-beginning 0) 5))
@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node."
(point))))
(Info-extract-menu-node-name "Bad format cross-reference")))))))
(setq tags-losing (not (Info-validate-tags-table)))
- (if (or lossages tags-losing)
+ (if (or Info-validate-lossages tags-losing)
(with-output-to-temp-buffer " *problems in info file*"
- (while lossages
+ (while Info-validate-lossages
(princ "In node \"")
- (princ (car (car lossages)))
+ (princ (car (car Info-validate-lossages)))
(princ "\", ")
- (let ((tem (nth 1 (car lossages))))
+ (let ((tem (nth 1 (car Info-validate-lossages))))
(cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0)))
(princ "..."))
(t
(princ tem))))
- (if (nth 2 (car lossages))
+ (if (nth 2 (car Info-validate-lossages))
(progn
(princ ": ")
- (let ((tem (nth 2 (car lossages))))
+ (let ((tem (nth 2 (car Info-validate-lossages))))
(cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0)))
(princ "..."))
(t
(princ tem))))))
(terpri)
- (setq lossages (cdr lossages)))
+ (setq Info-validate-lossages (cdr Info-validate-lossages)))
(if tags-losing (princ "\nTags table must be recomputed\n")))
;; Here if info file is valid.
;; If we already made a list of problems, clear it out.
@@ -306,16 +312,17 @@ Check that every node pointer points to an existing node."
(buffer-substring-no-properties
(point)
(progn
- (skip-chars-forward "^,\t\n")
- (skip-chars-backward " ")
- (point))))))
+ (skip-chars-forward "^,\t\n")
+ (skip-chars-backward " ")
+ (point))))))
(if (null name)
nil
(setq name (downcase name))
(or (and (> (length name) 0) (= (aref name 0) ?\())
- (assoc name allnodes)
- (setq lossages
- (cons (list thisnode kind name) lossages))))
+ (assoc name Info-validate-allnodes)
+ (setq Info-validate-lossages
+ (cons (list Info-validate-thisnode kind name)
+ Info-validate-lossages))))
name)
(defun Info-validate-tags-table ()
@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node."
(start (progn (search-backward "\nTag table:\n")
(1- (match-end 0))))
tem)
- (setq tem allnodes)
+ (setq tem Info-validate-allnodes)
(while tem
(goto-char start)
(or (equal (car (car tem)) "*")
@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node."
(setq tem (downcase (buffer-substring-no-properties
(match-beginning 1)
(match-end 1))))
- (setq tem (assoc tem allnodes))
+ (setq tem (assoc tem Info-validate-allnodes))
(if (or (not tem)
(< 1000 (progn
(goto-char (match-beginning 2))
@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
(error (message ">> Error: %s" (prin1-to-string err))))))
(kill-emacs error))))
+(provide 'informat)
+
;;; informat.el ends here
diff --git a/texinfo/emacs/makeinfo.el b/texinfo/emacs/makeinfo.el
index a649d522156..d6ee7bbb1c0 100644
--- a/texinfo/emacs/makeinfo.el
+++ b/texinfo/emacs/makeinfo.el
@@ -47,15 +47,24 @@
(require 'compile)
-(defvar makeinfo-run-command "makeinfo"
+(defgroup makeinfo nil
+ "Run makeinfo conveniently"
+ :group 'docs)
+
+
+(defcustom makeinfo-run-command "makeinfo"
"*Command used to run `makeinfo' subjob.
-The name of the file is appended to this string, separated by a space.")
+The name of the file is appended to this string, separated by a space."
+ :type 'string
+ :group 'makeinfo)
-(defvar makeinfo-options "--fill-column=70"
+(defcustom makeinfo-options "--fill-column=70"
"*String containing options for running `makeinfo'.
Do not include `--footnote-style' or `--paragraph-indent';
the proper way to specify those is with the Texinfo commands
-`@footnotestyle` and `@paragraphindent'.")
+`@footnotestyle` and `@paragraphindent'."
+ :type 'string
+ :group 'makeinfo)
(require 'texinfo)
diff --git a/texinfo/emacs/texinfmt.el b/texinfo/emacs/texinfmt.el
index c0d09635a8d..ffc8b1fb1e6 100644
--- a/texinfo/emacs/texinfmt.el
+++ b/texinfo/emacs/texinfmt.el
@@ -1,10 +1,8 @@
;;; texinfmt.el --- format Texinfo files into Info files.
-;; Copyright (C) 1985, 1986, 1988, 1990, 1991,
-;; 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993,
+;; 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
-;; Author: Robert J. Chassell
-;; Date: 10 Sep 1996
;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
;; Keywords: maint, tex, docs
@@ -29,7 +27,7 @@
;;; Emacs lisp functions to convert Texinfo files to Info files.
-(defvar texinfmt-version "2.35 of 10 September 1996")
+(defvar texinfmt-version "2.37 of 24 May 1997")
(defun texinfmt-version (&optional here)
"Show the version of texinfmt.el in the minibuffer.
@@ -101,7 +99,7 @@ If optional argument HERE is non-nil, insert info at point."
(defun texinfo-format-buffer (&optional notagify)
"Process the current buffer as texinfo code, into an Info file.
The Info file output is generated in a buffer visiting the Info file
-names specified in the @setfilename command.
+name specified in the @setfilename command.
Non-nil argument (prefix, if interactive) means don't make tag table
and don't split the file if large. You can use Info-tagify and
@@ -299,6 +297,33 @@ converted to Info is stored in a temporary buffer."
(message "Done.")))
+;;;###autoload
+(defun texi2info (&optional notagify)
+ "Convert the current buffer (written in Texinfo code) into an Info file.
+The Info file output is generated in a buffer visiting the Info file
+names specified in the @setfilename command.
+
+This function automatically updates all node pointers and menus, and
+creates a master menu. This work is done on a temporary buffer that
+is automatically removed when the Info file is created. The original
+Texinfo source buffer is not changed.
+
+Non-nil argument (prefix, if interactive) means don't make tag table
+and don't split the file if large. You can use Info-tagify and
+Info-split to do these manually."
+ (interactive "P")
+ (let ((temp-buffer (concat "*--" (buffer-name) "--temporary-buffer*" )))
+ (message "First updating nodes and menus, then creating Info file.")
+ ;; (sit-for 2)
+ (copy-to-buffer temp-buffer (point-min) (point-max))
+ (switch-to-buffer temp-buffer)
+ (texinfo-master-menu t)
+ (message "Now creating Info file.")
+ (sit-for 2)
+ (texinfo-format-buffer notagify)
+ (save-buffer)
+ (kill-buffer temp-buffer)))
+
;;; Primary internal formatting function for the whole buffer.
@@ -476,6 +501,7 @@ converted to Info is stored in a temporary buffer."
"bullet{\\|"
"cite{\\|"
"code{\\|"
+ "email{\\|"
"emph{\\|"
"equiv{\\|"
"error{\\|"
@@ -486,7 +512,6 @@ converted to Info is stored in a temporary buffer."
"kbd{\\|"
"key{\\|"
"lisp{\\|"
- "email{\\|"
"minus{\\|"
"point{\\|"
"print{\\|"
@@ -1049,12 +1074,10 @@ Leave point after argument."
(file-name-nondirectory (expand-file-name arg)))
(insert "Info file: "
texinfo-format-filename ", -*-Text-*-\n"
- ;; Date string removed so that regression testing is easier.
- ;; "produced on "
- ;; (substring (current-time-string) 8 10) " "
- ;; (substring (current-time-string) 4 7) " "
- ;; (substring (current-time-string) -4) " "
"produced by `texinfo-format-buffer'\n"
+ ;; Date string removed so that regression testing is easier.
+ ;; "on "
+ ;; (insert (format-time-string "%e %b %Y")) " "
"from file"
(if (buffer-file-name input-buffer)
(concat " `"
@@ -1714,7 +1737,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
;;
;; Using the Emacs Lisp formatter, texinfmt.el,
;; the whitespace between columns can be increased by setting
-;; `extra-inter-column-width' to a value greater than 0. By default,
+;; `texinfo-extra-inter-column-width' to a value greater than 0. By default,
;; there is at least one blank space between columns.
;;
;; The Emacs Lisp formatter, texinfmt.el, ignores the following four
@@ -1764,12 +1787,11 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
;; Note that @tab, the cell separators, are not treated as independent
;; Texinfo commands.
-(defvar extra-inter-column-width 0
-"*Insert NUMBER of additional columns of whitespace between entries of
-a multi-column table.")
+(defvar texinfo-extra-inter-column-width 0
+ "*Number of extra spaces between entries (columns) in @multitable.")
-(defvar multitable-temp-buffer-name "*multitable-temporary-buffer*")
-(defvar multitable-temp-rectangle-name "texinfo-multitable-temp-")
+(defvar texinfo-multitable-buffer-name "*multitable-temporary-buffer*")
+(defvar texinfo-multitable-rectangle-name "texinfo-multitable-temp-")
;; These commands are defined in texinfo.tex for printed output.
(put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args)
@@ -1778,6 +1800,7 @@ a multi-column table.")
(put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args)
(put 'multitable 'texinfo-format 'texinfo-multitable)
+
(defun texinfo-multitable ()
"Produce multi-column tables.
@@ -1806,7 +1829,7 @@ Long lines of text are filled within columns.
Using the Emacs Lisp formatter, texinfmt.el,
the whitespace between columns can be increased by setting
-`extra-inter-column-width' to a value greater than 0. By default,
+`texinfo-extra-inter-column-width' to a value greater than 0. By default,
there is at least one blank space between columns.
The Emacs Lisp formatter, texinfmt.el, ignores the following four
@@ -1895,7 +1918,7 @@ commands that are defined in texinfo.tex for printed output.
;; between column spaces
(length texinfo-multitable-width-list)
;; additional between column spaces, if any
- extra-inter-column-width
+ texinfo-extra-inter-column-width
;; sum of spaces for each entry
(apply '+ texinfo-multitable-width-list))))
(if (> desired-columns fill-column)
@@ -1941,7 +1964,7 @@ This command is executed when texinfmt sees @item inside @multitable."
;; extract-row command deletes the source line in the table.
(unformated-row (texinfo-multitable-extract-row)))
;; Use a temporary buffer
- (set-buffer (get-buffer-create multitable-temp-buffer-name))
+ (set-buffer (get-buffer-create texinfo-multitable-buffer-name))
(delete-region (point-min) (point-max))
(insert unformated-row)
(goto-char (point-min))
@@ -1968,7 +1991,7 @@ This command is executed when texinfmt sees @item inside @multitable."
(point)))
;; Set fill-column *wider* than needed to produce inter-column space
(setq fill-column (+ 1
- extra-inter-column-width
+ texinfo-extra-inter-column-width
(nth table-column table-widths)))
(narrow-to-region start end)
;; Remove whitespace before and after entry.
@@ -2000,7 +2023,7 @@ This command is executed when texinfmt sees @item inside @multitable."
(if (> needed-whitespace 0) needed-whitespace 1)
? )))
;; now, put formatted cell into a rectangle
- (set (intern (concat multitable-temp-rectangle-name
+ (set (intern (concat texinfo-multitable-rectangle-name
(int-to-string table-column)))
(extract-rectangle (point-min) (point)))
(delete-region (point-min) (point))
@@ -2023,12 +2046,12 @@ This command is executed when texinfmt sees @item inside @multitable."
(setq here (point))
(insert-rectangle
(eval (intern
- (concat multitable-temp-rectangle-name
+ (concat texinfo-multitable-rectangle-name
(int-to-string column-number)))))
(goto-char here)
(end-of-line)
(setq column-number (1+ column-number))))
- (kill-buffer multitable-temp-buffer-name)
+ (kill-buffer texinfo-multitable-buffer-name)
(setq fill-column existing-fill-column)))
@@ -2091,10 +2114,21 @@ This command is executed when texinfmt sees @item inside @multitable."
;; The `@today{}' command requires a pair of braces, like `@dots{}'.
(defun texinfo-format-today ()
(texinfo-parse-arg-discard)
- (insert (format "%s %s %s"
- (substring (current-time-string) 8 10)
- (substring (current-time-string) 4 7)
- (substring (current-time-string) -4))))
+ (insert (format-time-string "%e %b %Y")))
+
+
+;;; @timestamp{}
+;; Produce `Day Month Year Hour:Min' style of output.
+;; eg `1 Jan 1900 13:52'
+
+(put 'timestamp 'texinfo-format 'texinfo-format-timestamp)
+
+;; The `@timestamp{}' command requires a pair of braces, like `@dots{}'.
+(defun texinfo-format-timestamp ()
+ "Insert the current local time and date."
+ (texinfo-parse-arg-discard)
+ ;; For seconds and time zone, replace format string with "%e %b %Y %T %Z"
+ (insert (format-time-string "%e %b %Y %R")))
;;; @ignore
@@ -2217,8 +2251,9 @@ This command is executed when texinfmt sees @item inside @multitable."
(put 'email 'texinfo-format 'texinfo-format-key)
(put 'key 'texinfo-format 'texinfo-format-key)
+;; I've decided not want to have angle brackets around these -- rms.
(defun texinfo-format-key ()
- (insert "<" (texinfo-parse-arg-discard) ">")
+ (insert (texinfo-parse-arg-discard))
(goto-char texinfo-command-start))
(put 'bullet 'texinfo-format 'texinfo-format-bullet)
@@ -3705,13 +3740,12 @@ The command `@value{foo}' expands to the value."
;; In this case flag is neither set nor cleared.
;; Act as if clear, i.e. do nothing.
()))))
-
;;; @ifeq
(put 'ifeq 'texinfo-format 'texinfo-format-ifeq)
(defun texinfo-format-ifeq ()
- "If ARG1 and ARG2 caselessly string compare to same string, performs COMMAND.
+ "If ARG1 and ARG2 caselessly string compare to same string, perform COMMAND.
Otherwise produces no output.
Thus:
diff --git a/texinfo/emacs/texinfo.el b/texinfo/emacs/texinfo.el
index 0a1ab13401e..9e1099f4b88 100644
--- a/texinfo/emacs/texinfo.el
+++ b/texinfo/emacs/texinfo.el
@@ -1,10 +1,10 @@
-;;; texinfo.el--major mode for editing Texinfo files.
+;;; texinfo.el --- major mode for editing Texinfo files
;; Copyright (C) 1985, '88, '89, '90, '91,
-;; '92, '93, '96 Free Software Foundation, Inc.
+;; '92, '93, '96, '97 Free Software Foundation, Inc.
-;; Author: Robert J. Chassell
-;; Date: 6 Sep 1996
+;; Author: Robert J. Chassell
+;; Date: [Set date below for texinfo-version]
;; Maintainer: bug-texinfo@prep.ai.mit.edu
;; Keywords: maint, tex, docs
@@ -25,6 +25,26 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
+;;; Code:
+
+(defgroup texinfo nil
+ "Texinfo Mode"
+ :group 'docs)
+
+(defvar texinfo-version "2.37 of 24 May 1997")
+
+(defun texinfo-version (&optional here)
+ "Show the version of texinfo.el in the minibuffer.
+If optional argument HERE is non-nil, insert info at point."
+ (interactive "P")
+ (let ((version-string
+ (format "Version of \`texinfo.el\': %s" texinfo-version)))
+ (if here
+ (insert version-string)
+ (if (interactive-p)
+ (message "%s" version-string)
+ version-string))))
+
;;; Autoloads:
@@ -41,7 +61,7 @@ command to gain use of `next-error'."
"makeinfo"
"Make Info file from current buffer.
-Use the \\[next-error] command to move to the next error
+Use the \\[next-error] command to move to the next error
\(if there are errors\)."
t nil)
@@ -164,7 +184,7 @@ title of the section containing the menu."
(autoload 'texinfo-indent-menu-description
"texnfo-upd"
- "Indent every description in menu following point to COLUMN.
+ "Indent every description in menu following point to COLUMN.
Non-nil argument (prefix, if interactive) means indent every
description in every menu in the region. Does not indent second and
subsequent lines of a multi-line description."
@@ -180,7 +200,7 @@ node names in pre-existing @node lines that lack names."
(autoload 'texinfo-start-menu-description
"texnfo-upd"
- "In this menu entry, insert the node's section title as a description.
+ "In this menu entry, insert the node's section title as a description.
Position point at beginning of description ready for editing.
Do not insert a title if the line contains an existing description.
@@ -191,7 +211,7 @@ complements the node name rather than repeats it as a title does."
(autoload 'texinfo-multiple-files-update
"texnfo-upd"
"Update first node pointers in each file included in OUTER-FILE;
-create or update main menu in the outer file that refers to such nodes.
+create or update main menu in the outer file that refers to such nodes.
This does not create or update menus or pointers within the included files.
With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
@@ -205,7 +225,7 @@ a master menu in OUTER-FILE.
The command also updates the `Top' level node pointers of OUTER-FILE.
-Notes:
+Notes:
* this command does NOT save any files--you must save the
outer file and any modified, included files.
@@ -217,7 +237,7 @@ Notes:
Requirements:
* each of the included files must contain exactly one highest
- hierarchical level node,
+ hierarchical level node,
* this highest node must be the first node in the included file,
* each highest hierarchical level node must be of the same type.
@@ -261,11 +281,11 @@ chapter."
;; It didn't seem to be any better, and it's slower--simon.
("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments
;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line.
- ;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
+ ;;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands
("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face)
- ("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face)
+ ("@\\(file\\|kbd\\|key\\|url\\|email\\){\\([^}]+\\)" 2 font-lock-string-face)
("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)"
2 font-lock-variable-name-face)
("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face)
@@ -300,7 +320,7 @@ chapter."
(if (bobp)
0
(forward-char 1)
- (let* ((word (buffer-substring-no-properties
+ (let* ((word (buffer-substring-no-properties
(point) (progn (forward-word 1) (point))))
(entry (assoc word texinfo-section-list)))
(if entry
@@ -321,12 +341,13 @@ chapter."
(define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue)
(define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue)
(define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
+ (define-key keymap "\C-c\C-t\C-v" 'texinfo-tex-view)
(define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
(define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
(define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
-;; Mode documentation displays commands in reverse order
+;; Mode documentation displays commands in reverse order
;; from how they are listed in the texinfo-mode-map.
(if texinfo-mode-map
@@ -338,7 +359,7 @@ chapter."
;; bindings for `makeinfo.el'
(define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
- (define-key texinfo-mode-map "\C-c\C-m\C-l"
+ (define-key texinfo-mode-map "\C-c\C-m\C-l"
'makeinfo-recenter-compilation-buffer)
(define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
(define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
@@ -382,7 +403,7 @@ chapter."
;;; Texinfo mode
-(defvar texinfo-chapter-level-regexp
+(defvar texinfo-chapter-level-regexp
"chapter\\|unnumbered \\|appendix \\|majorheading\\|chapheading"
"Regular expression matching Texinfo chapter-level headings.
This does not match `@node' and does not match the `@top' command.")
@@ -429,7 +450,7 @@ Here are the functions:
texinfo-update-node \\[texinfo-update-node]
texinfo-every-node-update \\[texinfo-every-node-update]
- texinfo-sequential-node-update
+ texinfo-sequential-node-update
texinfo-make-menu \\[texinfo-make-menu]
texinfo-all-menus-update \\[texinfo-all-menus-update]
@@ -438,7 +459,7 @@ Here are the functions:
texinfo-indent-menu-description (column &optional region-p)
The `texinfo-column-for-description' variable specifies the column to
-which menu descriptions are indented.
+which menu descriptions are indented.
Passed an argument (a prefix argument, if interactive), the
`texinfo-update-node' and `texinfo-make-menu' functions do their jobs
@@ -461,19 +482,20 @@ value of texinfo-mode-hook."
(use-local-map texinfo-mode-map)
(set-syntax-table texinfo-mode-syntax-table)
(make-local-variable 'page-delimiter)
- (setq page-delimiter
- (concat
- "^@node [ \t]*[Tt]op\\|^@\\("
- texinfo-chapter-level-regexp
+ (setq page-delimiter
+ (concat
+ "^@node [ \t]*[Tt]op\\|^@\\("
+ texinfo-chapter-level-regexp
"\\)"))
(make-local-variable 'require-final-newline)
(setq require-final-newline t)
(make-local-variable 'indent-tabs-mode)
(setq indent-tabs-mode nil)
(make-local-variable 'paragraph-separate)
- (setq paragraph-separate (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-separate))
+ (setq paragraph-separate
+ (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
(make-local-variable 'paragraph-start)
- (setq paragraph-start (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-start))
+ (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
(make-local-variable 'fill-column)
(setq fill-column 72)
(make-local-variable 'comment-start)
@@ -487,16 +509,20 @@ value of texinfo-mode-hook."
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(texinfo-font-lock-keywords t))
(make-local-variable 'outline-regexp)
- (setq outline-regexp
+ (setq outline-regexp
(concat "@\\("
(mapconcat 'car texinfo-section-list "\\>\\|")
"\\>\\)"))
(make-local-variable 'outline-level)
(setq outline-level 'texinfo-outline-level)
(make-local-variable 'tex-start-of-header)
- (setq tex-start-of-header "%**start")
+ (setq tex-start-of-header "%\\*\\*start")
(make-local-variable 'tex-end-of-header)
- (setq tex-end-of-header "%**end")
+ (setq tex-end-of-header "%\\*\\*end")
+ (make-local-variable 'tex-first-line-header-regexp)
+ (setq tex-first-line-header-regexp "^\\\\input")
+ (make-local-variable 'tex-trailer)
+ (setq tex-trailer "@bye\n")
(run-hooks 'text-mode-hook 'texinfo-mode-hook))
@@ -543,10 +569,10 @@ value of texinfo-mode-hook."
(let ((depth 1) string)
(save-excursion
(while (and (> depth 0)
- (re-search-backward texinfo-environment-regexp nil t)
- (if (looking-at "@end")
- (setq depth (1+ depth))
- (setq depth (1- depth)))))
+ (re-search-backward texinfo-environment-regexp nil t))
+ (if (looking-at "@end")
+ (setq depth (1+ depth))
+ (setq depth (1- depth))))
(looking-at texinfo-environment-regexp)
(if (zerop depth)
(setq string
@@ -564,7 +590,7 @@ value of texinfo-mode-hook."
;; These commands use texinfo-insert-@-with-arg
(defun texinfo-insert-@-with-arg (string &optional arg)
- (if arg
+ (if arg
(progn
(setq arg (prefix-numeric-value arg))
(if (< arg 0)
@@ -662,14 +688,13 @@ The default is not to surround any existing words with the braces."
;;; Texinfo file structure
-;; These are defined in texnfo-upd.el.
-;; texinfo-section-types-regexp
-;; texinfo-section-level-regexp
-;; texinfo-subsection-level-regexp
-;; texinfo-subsubsection-level-regexp
+;; These are defined in texnfo-upd.el. defvars here avoid warnings.
+(defvar texinfo-section-types-regexp)
+(defvar texinfo-section-level-regexp)
+(defvar texinfo-subsection-level-regexp)
+(defvar texinfo-subsubsection-level-regexp)
-;; `texinfo-show-structure' requires texnfo-upd.el
-(defun texinfo-show-structure (&optional nodes-too)
+(defun texinfo-show-structure (&optional nodes-too)
"Show the structure of a Texinfo file.
List the lines in the file that begin with the @-sign commands for
@chapter, @section, and the like.
@@ -680,12 +705,12 @@ with @-sign commands for @chapter, @section, and the like, and list
Lines with structuring commands beginning in them are displayed in
another buffer named `*Occur*'. In that buffer, you can move point to
-one of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],
+one of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],
to jump to the corresponding spot in the Texinfo source file."
(interactive "P")
(require 'texnfo-upd)
- (save-excursion
+ (save-excursion
(goto-char (point-min))
(if nodes-too
(occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))
@@ -716,14 +741,14 @@ to jump to the corresponding spot in the Texinfo source file."
;; ((looking-at "@appendixsec ") 9)
;; ((looking-at "@heading ") 9)
- ((looking-at
+ ((looking-at
(concat "@\\(" texinfo-subsection-level-regexp "\\)")) 13)
;; ((looking-at "@subsection ") 13)
;; ((looking-at "@unnumberedsubsec ") 13)
;; ((looking-at "@appendixsubsec ") 13)
;; ((looking-at "@subheading ") 13)
- ((looking-at
+ ((looking-at
(concat "@\\(" texinfo-subsubsection-level-regexp "\\)")) 17)
;; ((looking-at "@subsubsection ") 17)
;; ((looking-at "@unnumberedsubsubsec ") 17)
@@ -735,20 +760,28 @@ to jump to the corresponding spot in the Texinfo source file."
;;; The tex and print function definitions:
-(defvar texinfo-texi2dvi-command "texi2dvi"
- "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer.")
+(defcustom texinfo-texi2dvi-command "texi2dvi"
+ "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer."
+ :type 'string
+ :group 'texinfo)
-(defvar texinfo-tex-command "tex"
- "*Command used by `texinfo-tex-region' to run TeX on a region.")
+(defcustom texinfo-tex-command "tex"
+ "*Command used by `texinfo-tex-region' to run TeX on a region."
+ :type 'string
+ :group 'texinfo)
-(defvar texinfo-texindex-command "texindex"
- "*Command used by `texinfo-texindex' to sort unsorted index files.")
+(defcustom texinfo-texindex-command "texindex"
+ "*Command used by `texinfo-texindex' to sort unsorted index files."
+ :type 'string
+ :group 'texinfo)
-(defvar texinfo-delete-from-print-queue-command "lprm"
+(defcustom texinfo-delete-from-print-queue-command "lprm"
"*Command string used to delete a job from the line printer queue.
Command is used by \\[texinfo-delete-from-print-queue] based on
number provided by a previous \\[tex-show-print-queue]
-command.")
+command."
+ :type 'string
+ :group 'texinfo)
(defvar texinfo-tex-trailer "@bye"
"String appended after a region sent to TeX by `texinfo-tex-region'.")
@@ -767,109 +800,16 @@ inclusive. The header must start in the first 100 lines.
The value of `texinfo-tex-trailer' is appended to the temporary file after the region."
(interactive "r")
(require 'tex-mode)
- (if (get-buffer "*tex-shell*")
- (tex-kill-job)
- (tex-start-shell))
- (or tex-zap-file (setq tex-zap-file (make-temp-name "#tz")))
- (let ((tex-out-file (concat tex-zap-file ".tex"))
- (temp-buffer (get-buffer-create " tex-Output-Buffer"))
- (zap-directory
- (file-name-as-directory (expand-file-name tex-directory))))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line 100)
- (let ((search-end (point))
- (hbeg (point-min)) (hend (point-min))
- (default-directory zap-directory))
- (goto-char (point-min))
-
- ;; Copy first line, the `\input texinfo' line, to temp file
- (write-region (point)
- (save-excursion (end-of-line) (point))
- tex-out-file nil nil)
-
- ;; Don't copy first line twice if region includes it.
- (forward-line 1)
- (if (< beg (point)) (setq beg (point)))
-
- ;; Initialize the temp file with either the header or nothing
- (if (search-forward tex-start-of-header search-end t)
- (progn
- (beginning-of-line)
- (setq hbeg (point)) ; Mark beginning of header.
- (if (search-forward tex-end-of-header nil t)
- (progn (beginning-of-line)
- (setq hend (point))) ; Mark end of header.
- (setq hbeg (point-min))))) ; Else no header.
-
- ;; Copy header to temp file.
- (write-region (min hbeg beg) hend tex-out-file t nil)
-
- ;; Copy region to temp file.
- (write-region (max beg hend) end tex-out-file t nil))
-
- ;; This is a kludge to insert the tex-trailer into the tex-out-file.
- ;; We have to create a special buffer in which to insert
- ;; the tex-trailer first because there is no function with
- ;; which to append a literal string directly to a file.
- (let ((local-tex-trailer texinfo-tex-trailer))
- (set-buffer temp-buffer)
- (erase-buffer)
- ;; make sure trailer isn't hidden by a comment
- (insert-string "\n")
- (if local-tex-trailer (insert-string local-tex-trailer))
- (tex-set-buffer-directory temp-buffer zap-directory)
- (write-region (point-min) (point-max) tex-out-file t nil))
-
-;;; The following is sufficient in Emacs 19.
-;;; (write-region (concat "\n" texinfo-tex-trailer) nil
-;;; tex-out-file t nil)
- ))
-
- (tex-set-buffer-directory "*tex-shell*" zap-directory)
- (tex-send-command tex-shell-cd-command zap-directory)
- (tex-send-command texinfo-tex-command tex-out-file)
- ;; alternatively:
- ;; (send-string "tex-shell" (concat tex-shell-cd-command " "
- ;; zap-directory "\n"))
- ;; (send-string "tex-shell" (concat texinfo-tex-command " "
- ;; tex-out-file "\n"))
- (tex-recenter-output-buffer 0)))
+ (let ((tex-command texinfo-tex-command)
+ (tex-trailer "@bye\n"))
+ (tex-region beg end)))
(defun texinfo-tex-buffer ()
"Run TeX on visited file, once or twice, to make a correct `.dvi' file."
(interactive)
-
- ;; Make sure TeX shell is running.
(require 'tex-mode)
- (if (get-buffer "*tex-shell*")
- (quit-process (get-process "tex-shell") t)
- (tex-start-shell))
-
- (cond ((null buffer-file-name)
- (error "Buffer not visiting any file!"))
- ((buffer-modified-p)
- (error "Buffer has been modified since last saved!")))
-
- (setq tex-zap-file buffer-file-name)
-
- (tex-send-command tex-shell-cd-command (file-name-directory tex-zap-file))
-
- (tex-send-command texinfo-texi2dvi-command tex-zap-file)
-
- ;; alternatively:
- ;; (send-string "tex-shell"
- ;; (concat tex-shell-cd-command
- ;; " " (file-name-directory tex-zap-file) "\n"))
- ;; )
- ;;
- ;; (send-string "tex-shell"
- ;; (concat texinfo-texi2dvi-command " " tex-zap-file "\n"))
-
-
- (tex-recenter-output-buffer 0))
+ (let ((tex-command texinfo-texi2dvi-command))
+ (tex-buffer)))
(defun texinfo-texindex ()
"Run `texindex' on unsorted index files.
@@ -889,12 +829,14 @@ This runs the shell command defined by `texinfo-texindex-command'."
This runs the shell command defined by `tex-dvi-print-command'."
(interactive)
(require 'tex-mode)
- (tex-send-command tex-dvi-print-command (concat tex-zap-file ".dvi"))
- ;; alternatively:
- ;; (send-string "tex-shell"
- ;; (concat tex-dvi-print-command
- ;; " " tex-zap-file ".dvi" "\n"))
- (tex-recenter-output-buffer nil))
+ (tex-print))
+
+(defun texinfo-tex-view ()
+ "View `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
+This runs the shell command defined by `tex-dvi-view-command'."
+ (interactive)
+ (require 'tex-mode)
+ (tex-view))
(defun texinfo-quit-job ()
"Quit currently running TeX job, by sending an `x' to it."
@@ -921,7 +863,7 @@ You are prompted for the job number (use a number shown by a previous
(tex-send-command texinfo-delete-from-print-queue-command job-number)
;; alternatively
;; (send-string "tex-shell"
- ;; (concat
+ ;; (concat
;; texinfo-delete-from-print-queue-command
;; " "
;; job-number"\n"))
diff --git a/texinfo/emacs/texnfo-upd.el b/texinfo/emacs/texnfo-upd.el
index 4827fe5f819..516c1a6130b 100644
--- a/texinfo/emacs/texnfo-upd.el
+++ b/texinfo/emacs/texnfo-upd.el
@@ -1,10 +1,9 @@
;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
-;; Copyright 1989, 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
-;; Date: 12 Sep 1996
-;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
+;; Maintainer: bug-texinfo@prep.ai.mit.edu
;; Keywords: maint, tex, docs
;; This file is part of GNU Emacs.
@@ -37,16 +36,16 @@
;; * insert or update the menu for a section,
;; * create a master menu for a Texinfo source file.
;;
-;; Passed an argument, the `texinfo-update-node' and
+;; With a prefix argument, the `texinfo-update-node' and
;; `texinfo-make-menu' functions do their jobs in the region.
;;
;; In brief, the functions for creating or updating nodes and menus, are:
;;
-;; texinfo-update-node (&optional region-p)
+;; texinfo-update-node (&optional beginning end)
;; texinfo-every-node-update ()
;; texinfo-sequential-node-update (&optional region-p)
;;
-;; texinfo-make-menu (&optional region-p)
+;; texinfo-make-menu (&optional beginning end)
;; texinfo-all-menus-update ()
;; texinfo-master-menu ()
;;
@@ -81,11 +80,11 @@
;;; The update node functions described in detail
-;; The `texinfo-update-node' function without an argument inserts
+;; The `texinfo-update-node' command with no prefix argument inserts
;; the correct next, previous and up pointers for the node in which
;; point is located (i.e., for the node preceding point).
-;; With an argument, the `texinfo-update-node' function inserts the
+;; With prefix argument, the `texinfo-update-node' function inserts the
;; correct next, previous and up pointers for the nodes inside the
;; region.
@@ -150,13 +149,16 @@
;;; Code:
-;;; The menu making functions
+(defvar texinfo-master-menu-header
+ " --- The Detailed Node Listing ---\n"
+ "String inserted before lower level entries in Texinfo master menu.
+It comes after the chapter-level menu entries.")
-(defun texinfo-make-menu (&optional region-p)
+(defun texinfo-make-menu (&optional beginning end)
"Without any prefix argument, make or update a menu.
Make the menu for the section enclosing the node found following point.
-Non-nil argument (prefix, if interactive) means make or update menus
+A prefix argument means make or update menus
for nodes within or part of the marked region.
Whenever a menu exists, and is being updated, the descriptions that
@@ -164,25 +166,24 @@ are associated with node names in the pre-existing menu are
incorporated into the new menu. Otherwise, the nodes' section titles
are inserted as descriptions."
- (interactive "P")
- (if (not region-p)
+ (interactive
+ (if prefix-arg
+ (list (point) (mark))))
+ (if (null beginning)
(let ((level (texinfo-hierarchic-level)))
(texinfo-make-one-menu level)
- (message "Done...updated the menu. You may save the buffer."))
+ (message "Menu updated"))
;; else
(message "Making or updating menus in %s... " (buffer-name))
- (let ((beginning (region-beginning))
- (region-end (region-end))
- (level (progn ; find section type following point
- (goto-char (region-beginning))
- (texinfo-hierarchic-level))))
- (if (= region-end beginning)
- (error "Please mark a region!"))
- (save-excursion
+ (save-excursion
+ (goto-char (min beginning end))
+ ;; find section type following point
+ (let ((level (texinfo-hierarchic-level))
+ (region-end (max beginning end)))
(save-restriction
(widen)
- (while (texinfo-find-lower-level-node level region-end)
+ (while (texinfo-find-lower-level-node level region-end)
(setq level (texinfo-hierarchic-level)) ; new, lower level
(texinfo-make-one-menu level))
@@ -192,7 +193,7 @@ are inserted as descriptions."
(while (texinfo-find-lower-level-node level region-end)
(setq level (texinfo-hierarchic-level)) ; new, lower level
(texinfo-make-one-menu level))))))
- (message "Done...updated menus. You may save the buffer.")))
+ (message "Making or updating menus in %s...done" (buffer-name))))
(defun texinfo-make-one-menu (level)
"Make a menu of all the appropriate nodes in this section.
@@ -201,10 +202,10 @@ at the level specified by LEVEL. Point is left at the end of menu."
(let*
((case-fold-search t)
(beginning
- (save-excursion
- (goto-char (texinfo-update-menu-region-beginning level))
- (end-of-line)
- (point)))
+ (save-excursion
+ (goto-char (texinfo-update-menu-region-beginning level))
+ (end-of-line)
+ (point)))
(end (texinfo-update-menu-region-end level))
(first (texinfo-menu-first-node beginning end))
(node-name (progn
@@ -233,9 +234,14 @@ nodes in the buffer before updating the menus."
(goto-char (point-min))
(message "Checking for a master menu in %s ... "(buffer-name))
(save-excursion
- (if (re-search-forward texinfo-master-menu-header nil t)
- ;; Remove detailed master menu listing
+ (if (search-forward texinfo-master-menu-header nil t)
(progn
+ ;; Check if @detailmenu kludge is used;
+ ;; if so, leave point before @detailmenu.
+ (search-backward "\n@detailmenu"
+ (save-excursion (forward-line -3) (point))
+ t)
+ ;; Remove detailed master menu listing
(setq master-menu-p t)
(goto-char (match-beginning 0))
(let ((end-of-detailed-menu-descriptions
@@ -249,21 +255,11 @@ nodes in the buffer before updating the menus."
(progn
(message "Updating all nodes in %s ... " (buffer-name))
(sleep-for 2)
- (push-mark (point-max) t)
- (goto-char (point-min))
- ;; Using the mark to pass bounds this way
- ;; is kludgy, but it's not worth fixing. -- rms.
- (let ((mark-active t))
- (texinfo-update-node t))))
+ (texinfo-update-node (point-min) (point-max))))
(message "Updating all menus in %s ... " (buffer-name))
(sleep-for 2)
- (push-mark (point-max) t)
- (goto-char (point-min))
- ;; Using the mark to pass bounds this way
- ;; is kludgy, but it's not worth fixing. -- rms.
- (let ((mark-active t))
- (texinfo-make-menu t))
+ (texinfo-make-menu (point-max) (point-min))
(if master-menu-p
(progn
@@ -438,7 +434,7 @@ old description into the new entry.
For this function, the new menu is a list made up of lists of dotted
pairs in which the first element of the pair is the node name and the
second element the description. The new menu is changed destructively.
-The old menu is the menu as it appears in the texinfo file."
+The old menu is the menu as it appears in the Texinfo file."
(let ((new-menu-list-pointer new-menu-list)
(end-of-menu (texinfo-menu-end)))
@@ -452,9 +448,9 @@ The old menu is the menu as it appears in the texinfo file."
;;
;; Recognize both when looking for the description.
(concat "\\* \\(" ; so only menu entries are found
- (car (car new-menu-list)) "::"
+ (regexp-quote (car (car new-menu-list))) "::"
"\\|"
- ".*: " (car (car new-menu-list)) "[.,\t\n]"
+ ".*: " (regexp-quote (car (car new-menu-list))) "[.,\t\n]"
"\\)"
) ; so only complete entries are found
end-of-menu
@@ -525,7 +521,7 @@ Single argument, END-OF-MENU, is position limiting search."
""))
(defun texinfo-menu-end ()
- "Return position of end of menu. Does not change location of point.
+ "Return position of end of menu, but don't move point.
Signal an error if not end of menu."
(save-excursion
(if (re-search-forward "^@end menu" nil t)
@@ -784,9 +780,14 @@ title of the section containing the menu."
(or (re-search-forward "^@node" nil t)
(error "Too few nodes for a master menu!"))
(point))))
- (if (re-search-forward texinfo-master-menu-header first-chapter t)
- ;; Remove detailed master menu listing
+ (if (search-forward texinfo-master-menu-header first-chapter t)
(progn
+ ;; Check if @detailmenu kludge is used;
+ ;; if so, leave point before @detailmenu.
+ (search-backward "\n@detailmenu"
+ (save-excursion (forward-line -3) (point))
+ t)
+ ;; Remove detailed master menu listing
(goto-char (match-beginning 0))
(let ((end-of-detailed-menu-descriptions
(save-excursion ; beginning of end menu line
@@ -800,15 +801,11 @@ title of the section containing the menu."
(message "Making a master menu in %s ...first updating all nodes... "
(buffer-name))
(sleep-for 2)
- (push-mark (point-max) t)
- (goto-char (point-min))
- (texinfo-update-node t)
+ (texinfo-update-node (point-min) (point-max))
(message "Updating all menus in %s ... " (buffer-name))
(sleep-for 2)
- (push-mark (point-max) t)
- (goto-char (point-min))
- (texinfo-make-menu t)))
+ (texinfo-make-menu (point-min) (point-max))))
(message "Now making the master menu in %s... " (buffer-name))
(sleep-for 2)
@@ -822,9 +819,14 @@ title of the section containing the menu."
(save-excursion
(goto-char (point-min))
- (if (re-search-forward texinfo-master-menu-header nil t)
+ (if (search-forward texinfo-master-menu-header nil t)
(progn
(goto-char (match-beginning 0))
+ ;; Check if @detailmenu kludge is used;
+ ;; if so, leave point before @detailmenu.
+ (search-backward "\n@detailmenu"
+ (save-excursion (forward-line -3) (point))
+ t)
(insert "\n")
(delete-blank-lines)
(goto-char (point-min))))
@@ -880,59 +882,63 @@ However, there does not need to be a title field."
(point)
(save-excursion (re-search-forward "^@end menu") (point)))
- (save-excursion ; leave point at beginning of menu
- ;; Handle top of menu
- (insert "\n@menu\n")
- ;; Insert chapter menu entries
- (setq this-very-menu-list (reverse (car (car master-menu-list))))
- ;; Tell user what is going on.
- (message "Inserting chapter menu entry: %s ... " this-very-menu-list)
- (while this-very-menu-list
- (insert "* " (car this-very-menu-list) "\n")
- (setq this-very-menu-list (cdr this-very-menu-list)))
-
- (setq master-menu-list (cdr master-menu-list))
+ (save-excursion
+ ;; `master-menu-inserted-p' is a kludge to tell
+ ;; whether to insert @end detailmenu (see bleow)
+ (let (master-menu-inserted-p)
+ ;; Handle top of menu
+ (insert "\n@menu\n")
+ ;; Insert chapter menu entries
+ (setq this-very-menu-list (reverse (car (car master-menu-list))))
+ ;; Tell user what is going on.
+ (message "Inserting chapter menu entry: %s ... " this-very-menu-list)
+ (while this-very-menu-list
+ (insert "* " (car this-very-menu-list) "\n")
+ (setq this-very-menu-list (cdr this-very-menu-list)))
- ;; Only insert detailed master menu if there is one....
- (if (car (car master-menu-list))
-;; @detailmenu added 5 Sept 1996 at Karl Berry's request to avert a
-;; bug in `makeinfo'; all agree this is a bad kluge and should
-;; eventually be removed. @detailmenu ... @end detailmenu is a noop
-;; in `texinfmt.el' See @end detailmenu below
-;; also see `texinfo-all-menus-update' above, `texinfo-master-menu',
-;; `texinfo-multiple-files-update'
- (insert texinfo-master-menu-header))
+ (setq master-menu-list (cdr master-menu-list))
- ;; Now, insert all the other menus
+ ;; Only insert detailed master menu if there is one....
+ (if (car (car master-menu-list))
+ (progn (setq master-menu-inserted-p t)
+ (insert (concat "\n@detailmenu" texinfo-master-menu-header))))
+
+ ;; @detailmenu added 5 Sept 1996 to `texinfo-master-menu-header'
+ ;; at Karl Berry's request to avert a bug in `makeinfo';
+ ;; all agree this is a bad kludge and should eventually be removed.
+ ;; @detailmenu ... @end detailmenu is a noop in `texinfmt.el'.
+ ;; See @end detailmenu below;
+ ;; also see `texinfo-all-menus-update' above, `texinfo-master-menu',
+ ;; `texinfo-multiple-files-update'.
+
+ ;; Now, insert all the other menus
- ;; The menu master-menu-list has a form like this:
- ;; ((("beta" "alpha") "title-A")
- ;; (("delta" "gamma") "title-B"))
+ ;; The menu master-menu-list has a form like this:
+ ;; ((("beta" "alpha") "title-A")
+ ;; (("delta" "gamma") "title-B"))
- (while master-menu-list
+ (while master-menu-list
- (message
- "Inserting menu for %s .... " (car (cdr (car master-menu-list))))
- ;; insert title of menu section
- (insert "\n" (car (cdr (car master-menu-list))) "\n\n")
+ (message
+ "Inserting menu for %s .... " (car (cdr (car master-menu-list))))
+ ;; insert title of menu section
+ (insert "\n" (car (cdr (car master-menu-list))) "\n\n")
- ;; insert each menu entry
- (setq this-very-menu-list (reverse (car (car master-menu-list))))
- (while this-very-menu-list
- (insert "* " (car this-very-menu-list) "\n")
- (setq this-very-menu-list (cdr this-very-menu-list)))
+ ;; insert each menu entry
+ (setq this-very-menu-list (reverse (car (car master-menu-list))))
+ (while this-very-menu-list
+ (insert "* " (car this-very-menu-list) "\n")
+ (setq this-very-menu-list (cdr this-very-menu-list)))
- (setq master-menu-list (cdr master-menu-list)))
+ (setq master-menu-list (cdr master-menu-list)))
- ;; Finish menu
-;; @detailmenu (see note above)
- (insert "\n@end detailmenu")
- (insert "\n@end menu\n\n")))
+ ;; Finish menu
-(defvar texinfo-master-menu-header
- "\n@detailmenu\n --- The Detailed Node Listing ---\n"
- "String inserted before lower level entries in Texinfo master menu.
-It comes after the chapter-level menu entries.")
+ ;; @detailmenu (see note above)
+ ;; Only insert @end detailmenu if a master menu was inserted.
+ (if master-menu-inserted-p
+ (insert "\n@end detailmenu"))
+ (insert "\n@end menu\n\n"))))
(defun texinfo-locate-menu-p ()
"Find the next menu in the texinfo file.
@@ -1005,18 +1011,18 @@ error if the node is not the top node and a section is not found."
(cond
((re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)"
;;; Following search limit by cph but causes a bug
-;;; (save-excursion
-;;; (end-of-line)
-;;; (point))
+;;; (save-excursion
+;;; (end-of-line)
+;;; (point))
nil
t)
"top")
((re-search-forward texinfo-section-types-regexp nil t)
(buffer-substring-no-properties
- (progn (beginning-of-line) ; copy its name
- (1+ (point)))
- (progn (forward-word 1)
- (point))))
+ (progn (beginning-of-line) ; copy its name
+ (1+ (point)))
+ (progn (forward-word 1)
+ (point))))
(t
(error
"texinfo-specific-section-type: Chapter or section not found."))))))
@@ -1236,15 +1242,14 @@ document; the values are regular expressions.")
;;; Updating a node
;;;###autoload
-(defun texinfo-update-node (&optional region-p)
+(defun texinfo-update-node (&optional beginning end)
"Without any prefix argument, update the node in which point is located.
-Non-nil argument (prefix, if interactive) means update the nodes in the
-marked region.
+Interactively, a prefix argument means to operate on the region.
The functions for creating or updating nodes and menus, and their
keybindings, are:
- texinfo-update-node (&optional region-p) \\[texinfo-update-node]
+ texinfo-update-node (&optional beginning end) \\[texinfo-update-node]
texinfo-every-node-update () \\[texinfo-every-node-update]
texinfo-sequential-node-update (&optional region-p)
@@ -1257,41 +1262,35 @@ keybindings, are:
The `texinfo-column-for-description' variable specifies the column to
which menu descriptions are indented. Its default value is 32."
- (interactive "P")
- (if (not region-p)
- ;; update a single node
+ (interactive
+ (if prefix-arg
+ (list (point) (mark))))
+ (if (null beginning)
+ ;; Update a single node.
(let ((auto-fill-function nil) (auto-fill-hook nil))
(if (not (re-search-backward "^@node" (point-min) t))
- (error "Node line not found before this position."))
+ (error "Node line not found before this position"))
(texinfo-update-the-node)
(message "Done...updated the node. You may save the buffer."))
;; else
(let ((auto-fill-function nil)
- (auto-fill-hook nil)
- (beginning (region-beginning))
- (end (region-end)))
- (if (= end beginning)
- (error "Please mark a region!"))
- (save-restriction
- (narrow-to-region beginning end)
- (goto-char beginning)
- (push-mark (point) t)
- (while (re-search-forward "^@node" (point-max) t)
- (beginning-of-line)
- (texinfo-update-the-node))
- (message "Done...updated nodes in region. You may save the buffer.")))))
+ (auto-fill-hook nil))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beginning end)
+ (goto-char (point-min))
+ (while (re-search-forward "^@node" (point-max) t)
+ (beginning-of-line)
+ (texinfo-update-the-node))
+ (goto-char (point-max))
+ (message "Done...nodes updated in region. You may save the buffer."))))))
;;;###autoload
(defun texinfo-every-node-update ()
"Update every node in a Texinfo file."
(interactive)
(save-excursion
- (push-mark (point-max) t)
- (goto-char (point-min))
- ;; Using the mark to pass bounds this way
- ;; is kludgy, but it's not worth fixing. -- rms.
- (let ((mark-active t))
- (texinfo-update-node t))
+ (texinfo-update-node (point-min) (point-max))
(message "Done...updated every node. You may save the buffer.")))
(defun texinfo-update-the-node ()
@@ -1366,7 +1365,7 @@ line, including the comma. Leaves point at beginning of line."
(defun texinfo-find-pointer (beginning end level direction)
"Move point to section associated with next, previous, or up pointer.
-Return type of pointer (either 'normal or 'no-pointer).
+Return type of pointer (either `normal' or `no-pointer').
The first and second arguments bound the search for a pointer to the
beginning and end, respectively, of the enclosing higher level
@@ -1447,7 +1446,7 @@ will be at some level higher in the Texinfo file. The fourth argument
(defun texinfo-pointer-name (kind)
"Return the node name preceding the section command.
-The argument is the kind of section, either normal or no-pointer."
+The argument is the kind of section, either `normal' or `no-pointer'."
(let (name)
(cond ((eq kind 'normal)
(end-of-line) ; this handles prev node top case
@@ -1456,8 +1455,10 @@ The argument is the kind of section, either normal or no-pointer."
(save-excursion (forward-line -3))
t)
(setq name (texinfo-copy-node-name)))
- ((eq kind 'no-pointer)
- (setq name " "))) ; put a blank in the pointer slot
+ ((eq kind 'no-pointer)
+ ;; Don't need to put a blank in the pointer slot,
+ ;; since insert "' " always has a space
+ (setq name " "))) ; put a blank in the pointer slot
name))
(defun texinfo-insert-pointer (beginning end level direction)
@@ -1468,8 +1469,7 @@ The first and second arguments bound the search for a pointer to the
beginning and end, respectively, of the enclosing higher level
section. The third argument is the hierarchical level of the Texinfo
file, a string such as \"section\". The fourth argument is direction
-towards which the pointer is directed, one of `next, `previous, or
-'up."
+towards which the pointer is directed, one of `next', `previous', or `up'."
(end-of-line)
(insert
@@ -1523,7 +1523,7 @@ Info `g*' command is inadequate."
"Done...sequentially updated the node . You may save the buffer."))
;; else
(let ((auto-fill-function nil)
- (auto-fill-hook nil)
+ (auto-fill-hook nil)
(beginning (region-beginning))
(end (region-end)))
(if (= end beginning)
@@ -1565,13 +1565,13 @@ regardless of its hierarchical level."
Move point to section associated with the pointer. Find point even if
it is in a different section.
-Return type of pointer (either 'normal or 'no-pointer).
+Return type of pointer (either `normal' or `no-pointer').
The first argument is a string specifying the general kind of section
such as \"chapter\" or \"section\". The section found will be at the
same hierarchical level in the Texinfo file, or, in the case of the up
-pointer, some level higher. The second argument (one of 'next,
-'previous, or 'up) specifies whether to find the `Next', `Previous',
+pointer, some level higher. The second argument (one of `next',
+`previous', or `up') specifies whether to find the `Next', `Previous',
or `Up' pointer."
(let ((case-fold-search t))
(cond ((eq direction 'next)
@@ -1605,7 +1605,7 @@ Move point forward.
The first argument is the hierarchical level of the Texinfo file, a
string such as \"section\". The second argument is direction, one of
-`next, `previous, or 'up."
+`next', `previous', or `up'."
(end-of-line)
(insert
@@ -1624,7 +1624,7 @@ string such as \"section\". The second argument is direction, one of
"Insert missing `@node' lines in region of Texinfo file.
Non-nil argument (prefix, if interactive) means also to insert the
section titles as node names; and also to insert the section titles as
-node names in pre-existing @node lines that lack names."
+node names in pre-existing `@node' lines that lack names."
(interactive "r\nP")
;; Use marker; after inserting node lines, leave point at end of
@@ -1785,8 +1785,7 @@ Requirements:
* this node must be the first node in the included file,
* each highest hierarchical level node must be of the same type.
-Thus, normally, each included file contains one, and only one,
-chapter."
+Thus, normally, each included file contains one, and only one, chapter."
;; The menu-list has the form:
;;
@@ -1879,7 +1878,7 @@ chapter."
(defun texinfo-multi-files-insert-main-menu (menu-list)
"Insert formatted main menu at point.
Indents the first line of the description, if any, to the value of
-texinfo-column-for-description."
+`texinfo-column-for-description'."
(insert "@menu\n")
(while menu-list
@@ -2019,10 +2018,15 @@ chapter."
(progn
;; First, removing detailed part of any pre-existing master menu
(goto-char (point-min))
- (if (re-search-forward texinfo-master-menu-header nil t)
- ;; Remove detailed master menu listing
+ (if (search-forward texinfo-master-menu-header nil t)
(progn
(goto-char (match-beginning 0))
+ ;; Check if @detailmenu kludge is used;
+ ;; if so, leave point before @detailmenu.
+ (search-backward "\n@detailmenu"
+ (save-excursion (forward-line -3) (point))
+ t)
+ ;; Remove detailed master menu listing
(let ((end-of-detailed-menu-descriptions
(save-excursion ; beginning of end menu line
(goto-char (texinfo-menu-end))