1995-10-30 17:35:01 +00:00
|
|
|
|
;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
|
1995-10-30 22:13:36 +00:00
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
|
;; Copyright (C) 1989-1992, 2001-2020 Free Software Foundation, Inc.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; Author: Robert J. Chassell
|
2019-05-25 13:43:06 -07:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1992-07-17 20:24:00 +00:00
|
|
|
|
;; Keywords: maint, tex, docs
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 04:34:22 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 04:34:22 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
;; 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
|
2017-09-13 15:52:52 -07:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1992-07-14 21:51:51 +00:00
|
|
|
|
;;; Commentary:
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; Known bug: update commands fail to ignore @ignore, and fail to DTRT
|
|
|
|
|
;; with the @if... directives (so expect trouble when the manual uses
|
|
|
|
|
;; different @node lines or @menu items in @iftex and in @ifnottex).
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
|
|
|
|
;; Summary: how to use the updating commands
|
|
|
|
|
|
|
|
|
|
;; The node and menu updating functions automatically
|
|
|
|
|
|
|
|
|
|
;; * insert missing `@node' lines,
|
|
|
|
|
;; * insert the `Next', `Previous' and `Up' pointers of a node,
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; * insert or update the menu for a section,
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; * create a master menu for a Texinfo source file.
|
|
|
|
|
;;
|
1997-04-05 21:59:09 +00:00
|
|
|
|
;; With a prefix argument, the `texinfo-update-node' and
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; `texinfo-make-menu' functions do their jobs in the region.
|
|
|
|
|
;;
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; Important note: We do NOT recommend use of these commands to update
|
|
|
|
|
;; the `Next', `Previous' and `Up' pointers on @node lines. Most
|
2011-12-30 17:27:15 -08:00
|
|
|
|
;; manuals, including those whose Texinfo files adhere to the structure
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; described below, don't need these pointers, because makeinfo will
|
|
|
|
|
;; generate them automatically (see the node "makeinfo Pointer
|
|
|
|
|
;; Creation" in the Texinfo manual). By contrast, due to known bugs
|
|
|
|
|
;; described above, texinfo-update-node etc. could produce incorrect
|
|
|
|
|
;; pointers, and thus make a perfectly valid Texinfo file into an
|
|
|
|
|
;; invalid one. You _have_ been warned!
|
|
|
|
|
;;
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; In brief, the functions for creating or updating nodes and menus, are:
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
|
|
|
|
;; texinfo-update-node (&optional beginning end)
|
|
|
|
|
;; texinfo-every-node-update ()
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; texinfo-sequential-node-update (&optional region-p)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
|
|
|
|
;; texinfo-make-menu (&optional beginning end)
|
|
|
|
|
;; texinfo-all-menus-update ()
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; texinfo-master-menu ()
|
|
|
|
|
;;
|
|
|
|
|
;; texinfo-insert-node-lines (&optional title-p)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; texinfo-indent-menu-description (column &optional region-p)
|
|
|
|
|
|
|
|
|
|
;; The `texinfo-column-for-description' variable specifies the column to
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; which menu descriptions are indented.
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
|
|
|
|
;; Texinfo file structure
|
|
|
|
|
;; ----------------------
|
|
|
|
|
|
|
|
|
|
;; To use the updating commands, you must structure your Texinfo file
|
|
|
|
|
;; hierarchically. Each `@node' line, with the exception of the top
|
|
|
|
|
;; node, must be accompanied by some kind of section line, such as an
|
|
|
|
|
;; `@chapter' or `@section' line. Each node-line/section-line
|
|
|
|
|
;; combination must look like this:
|
|
|
|
|
|
|
|
|
|
;; @node Lists and Tables, Cross References, Structuring, Top
|
|
|
|
|
;; @comment node-name, next, previous, up
|
|
|
|
|
;; @chapter Making Lists and Tables
|
|
|
|
|
|
|
|
|
|
;; or like this (without the `@comment' line):
|
|
|
|
|
|
|
|
|
|
;; @node Lists and Tables, Cross References, Structuring, Top
|
|
|
|
|
;; @chapter Making Lists and Tables
|
|
|
|
|
|
|
|
|
|
;; If the file has a `top' node, it must be called `top' or `Top' and
|
|
|
|
|
;; be the first node in the file.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; The update node functions described in detail
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
;; The `texinfo-update-node' command with no prefix argument inserts
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; the correct next, previous and up pointers for the node in which
|
|
|
|
|
;; point is located (i.e., for the node preceding point).
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
;; With prefix argument, the `texinfo-update-node' function inserts the
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; correct next, previous and up pointers for the nodes inside the
|
|
|
|
|
;; region.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; It does not matter whether the `@node' line has pre-existing
|
|
|
|
|
;; `Next', `Previous', or `Up' pointers in it. They are removed.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; Warning: Since the pre-existing pointers are replaced with the ones
|
|
|
|
|
;; computed by `texinfo-update-node', and since this function has
|
|
|
|
|
;; known bugs with the more advanced Texinfo features (see above), it
|
|
|
|
|
;; could produce an invalid Texinfo file. You are well advised not to
|
|
|
|
|
;; use this function, except if you know what you are doing and
|
|
|
|
|
;; exercise extreme caution. Keep in mind that most manuals do not
|
|
|
|
|
;; need the `Next', `Previous', and `Up' pointers to be present on the
|
|
|
|
|
;; @node lines; makeinfo will automatically generate them when it
|
|
|
|
|
;; produces the Info or HTML versions of the manual.
|
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; The `texinfo-every-node-update' function runs `texinfo-update-node'
|
|
|
|
|
;; on the whole buffer.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; The `texinfo-sequential-node-update' function inserts the
|
|
|
|
|
;; immediately following and preceding node into the `Next' or
|
|
|
|
|
;; `Previous' pointers regardless of their hierarchical level. This is
|
|
|
|
|
;; only useful for certain kinds of text, like a novel, which you go
|
|
|
|
|
;; through sequentially.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; The menu making functions described in detail
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; The `texinfo-make-menu' function without an argument creates or
|
|
|
|
|
;; updates a menu for the section encompassing the node that follows
|
|
|
|
|
;; point. With an argument, it makes or updates menus for the nodes
|
|
|
|
|
;; within or part of the marked region.
|
|
|
|
|
|
|
|
|
|
;; Whenever an existing menu is updated, the descriptions from
|
|
|
|
|
;; that menu are incorporated into the new menu. This is done by copying
|
|
|
|
|
;; descriptions from the existing menu to the entries in the new menu
|
|
|
|
|
;; that have the same node names. If the node names are different, the
|
|
|
|
|
;; descriptions are not copied to the new menu.
|
|
|
|
|
|
|
|
|
|
;; Menu entries that refer to other Info files are removed since they
|
|
|
|
|
;; are not a node within current buffer. This is a deficiency.
|
|
|
|
|
|
|
|
|
|
;; The `texinfo-all-menus-update' function runs `texinfo-make-menu'
|
|
|
|
|
;; on the whole buffer.
|
|
|
|
|
|
|
|
|
|
;; The `texinfo-master-menu' function creates an extended menu located
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; after the top node. (The file must have a top node.) This
|
2011-12-10 14:22:25 +02:00
|
|
|
|
;; function works only on Texinfo files all of whose menus are
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; present in a single file; use `texinfo-multiple-files-update' for
|
2011-12-10 14:22:25 +02:00
|
|
|
|
;; multi-file manuals. The function constructs a master menu that
|
|
|
|
|
;; includes every entry from every other menu. Use this command to
|
|
|
|
|
;; create or update the @detailmenu menu after you've created or
|
|
|
|
|
;; updated all the menus in the file, including the menu in the Top
|
|
|
|
|
;; node, using the `texinfo-make-menu' or the `texinfo-all-menus-update'
|
|
|
|
|
;; command.
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
|
|
|
|
;; The `texinfo-indent-menu-description' function indents every
|
|
|
|
|
;; description in the menu following point, to the specified column.
|
|
|
|
|
;; Non-nil argument (prefix, if interactive) means indent every
|
|
|
|
|
;; description in every menu in the region. This function does not
|
|
|
|
|
;; indent second and subsequent lines of a multi-line description.
|
|
|
|
|
|
|
|
|
|
;; The `texinfo-insert-node-lines' function inserts `@node' before the
|
|
|
|
|
;; `@chapter', `@section', and such like lines of a region in a Texinfo
|
|
|
|
|
;; file where the `@node' lines are missing.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; With a non-nil argument (prefix, if interactive), the function not
|
|
|
|
|
;; only inserts `@node' lines but also inserts the chapter or section
|
|
|
|
|
;; titles as the names of the corresponding nodes; and inserts titles
|
|
|
|
|
;; as node names in pre-existing `@node' lines that lack names.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; Since node names should be more concise than section or chapter
|
2011-12-10 12:49:33 +02:00
|
|
|
|
;; titles, you will usually want to manually edit node names so inserted.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
2000-11-06 15:53:05 +00:00
|
|
|
|
(require 'texinfo)
|
1997-08-30 19:48:14 +00:00
|
|
|
|
|
|
|
|
|
|
1997-07-18 02:57:14 +00:00
|
|
|
|
(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.")
|
|
|
|
|
|
2001-10-25 03:39:43 +00:00
|
|
|
|
;; We used to look for just sub, but that found @subtitle.
|
|
|
|
|
(defvar texinfo-section-types-regexp
|
|
|
|
|
"^@\\(chapter \\|sect\\|subs\\|subh\\|unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
|
|
|
|
|
"Regexp matching chapter, section, other headings (but not the top node).")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-section-level-regexp
|
|
|
|
|
(regexp-opt (texinfo-filter 3 texinfo-section-list))
|
|
|
|
|
"Regular expression matching just the Texinfo section level headings.")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-subsection-level-regexp
|
|
|
|
|
(regexp-opt (texinfo-filter 4 texinfo-section-list))
|
|
|
|
|
"Regular expression matching just the Texinfo subsection level headings.")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-subsubsection-level-regexp
|
|
|
|
|
(regexp-opt (texinfo-filter 5 texinfo-section-list))
|
|
|
|
|
"Regular expression matching just the Texinfo subsubsection level headings.")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-update-menu-same-level-regexps
|
|
|
|
|
'((1 . "top[ \t]+")
|
|
|
|
|
(2 . (concat "\\(^@\\)\\(" texinfo-chapter-level-regexp "\\)\\>[ \t]*"))
|
|
|
|
|
(3 . (concat "\\(^@\\)\\(" texinfo-section-level-regexp "\\)\\>[ \t]*"))
|
|
|
|
|
(4 . (concat "\\(^@\\)\\(" texinfo-subsection-level-regexp "\\)\\>[ \t]+"))
|
|
|
|
|
(5 . (concat "\\(^@\\)\\(" texinfo-subsubsection-level-regexp "\\)\\>[ \t]+")))
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Regexps for searching for same level sections in a Texinfo file.
|
2001-10-25 03:39:43 +00:00
|
|
|
|
The keys are strings specifying the general hierarchical level in the
|
|
|
|
|
document; the values are regular expressions.")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-update-menu-higher-regexps
|
|
|
|
|
'((1 . "^@node [ \t]*DIR")
|
|
|
|
|
(2 . "^@node [ \t]*top[ \t]*\\(,\\|$\\)")
|
|
|
|
|
(3 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-chapter-level-regexp
|
|
|
|
|
"\\)\\>[ \t]*\\)"))
|
|
|
|
|
(4 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-section-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-chapter-level-regexp
|
|
|
|
|
"\\)\\>[ \t]*\\)"))
|
|
|
|
|
(5 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-subsection-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-section-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-chapter-level-regexp
|
|
|
|
|
"\\)\\>[ \t]*\\)")))
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Regexps for searching for higher level sections in a Texinfo file.
|
2001-10-25 03:39:43 +00:00
|
|
|
|
The keys are strings specifying the general hierarchical level in the
|
|
|
|
|
document; the values are regular expressions.")
|
|
|
|
|
|
|
|
|
|
(defvar texinfo-update-menu-lower-regexps
|
|
|
|
|
'((1 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-chapter-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-section-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-subsection-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-subsubsection-level-regexp
|
|
|
|
|
"\\)\\>[ \t]*\\)"))
|
|
|
|
|
(2 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-section-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-subsection-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-subsubsection-level-regexp
|
|
|
|
|
"\\)\\>[ \t]*\\)"))
|
|
|
|
|
(3 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-subsection-level-regexp
|
|
|
|
|
"\\|"
|
|
|
|
|
texinfo-subsubsection-level-regexp
|
|
|
|
|
"\\)\\>[ \t]+\\)"))
|
|
|
|
|
(4 .
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@\\("
|
|
|
|
|
texinfo-subsubsection-level-regexp
|
|
|
|
|
"\\)\\>[ \t]+\\)"))
|
|
|
|
|
;; There's nothing below 5, use a bogus regexp that can't match.
|
|
|
|
|
(5 . "a\\(^\\)"))
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Regexps for searching for lower level sections in a Texinfo file.
|
2001-10-25 03:39:43 +00:00
|
|
|
|
The keys are strings specifying the general hierarchical level in the
|
|
|
|
|
document; the values are regular expressions.")
|
|
|
|
|
|
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(defun texinfo-make-menu (&optional beginning end)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Without any prefix argument, make or update a menu.
|
|
|
|
|
Make the menu for the section enclosing the node found following point.
|
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
A prefix argument means make or update menus
|
1990-10-20 02:38:04 +00:00
|
|
|
|
for nodes within or part of the marked region.
|
|
|
|
|
|
|
|
|
|
Whenever a menu exists, and is being updated, the descriptions that
|
|
|
|
|
are associated with node names in the pre-existing menu are
|
2002-02-20 17:39:38 +00:00
|
|
|
|
incorporated into the new menu.
|
|
|
|
|
|
|
|
|
|
Leaves trailing whitespace in a menu that lacks descriptions, so
|
|
|
|
|
descriptions will format well. In general, a menu should contain
|
|
|
|
|
descriptions, because node names and section titles are often too
|
|
|
|
|
short to explain a node well."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(interactive
|
|
|
|
|
(if prefix-arg
|
|
|
|
|
(list (point) (mark))))
|
|
|
|
|
(if (null beginning)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(let ((level (texinfo-hierarchic-level)))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(texinfo-make-one-menu level)
|
|
|
|
|
(message "Menu updated"))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; else
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(message "Making or updating menus in %s... " (buffer-name))
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (min beginning end))
|
|
|
|
|
;; find section type following point
|
|
|
|
|
(let ((level (texinfo-hierarchic-level))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(region-end-marker (make-marker)))
|
|
|
|
|
(set-marker region-end-marker (max beginning end))
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(while (texinfo-find-lower-level-node
|
|
|
|
|
level (marker-position region-end-marker))
|
|
|
|
|
(setq level (texinfo-hierarchic-level)) ; new, lower level
|
|
|
|
|
(texinfo-make-one-menu level))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(while (and (< (point) (marker-position region-end-marker))
|
|
|
|
|
(texinfo-find-higher-level-node
|
|
|
|
|
level (marker-position region-end-marker)))
|
|
|
|
|
(setq level (texinfo-hierarchic-level))
|
1998-10-11 12:47:19 +00:00
|
|
|
|
;; Don't allow texinfo-find-higher-level-node
|
|
|
|
|
;; to find the same node again.
|
|
|
|
|
(forward-line 1)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(while (texinfo-find-lower-level-node
|
|
|
|
|
level (marker-position region-end-marker))
|
|
|
|
|
(setq level (texinfo-hierarchic-level)) ; new, lower level
|
|
|
|
|
(texinfo-make-one-menu level))))))
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(message "Making or updating menus in %s...done" (buffer-name))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-make-one-menu (level)
|
|
|
|
|
"Make a menu of all the appropriate nodes in this section.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
`Appropriate nodes' are those associated with sections that are
|
1990-10-20 02:38:04 +00:00
|
|
|
|
at the level specified by LEVEL. Point is left at the end of menu."
|
|
|
|
|
(let*
|
|
|
|
|
((case-fold-search t)
|
1990-12-20 20:38:22 +00:00
|
|
|
|
(beginning
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (texinfo-update-menu-region-beginning level))
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(point)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(end (texinfo-update-menu-region-end level))
|
|
|
|
|
(first (texinfo-menu-first-node beginning end))
|
|
|
|
|
(node-name (progn
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(goto-char beginning)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-copy-node-name)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(new-menu-list (texinfo-make-menu-list beginning end level)))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when (texinfo-old-menu-p beginning first)
|
|
|
|
|
(texinfo-incorporate-descriptions new-menu-list)
|
|
|
|
|
(texinfo-incorporate-menu-entry-names new-menu-list)
|
|
|
|
|
(texinfo-delete-old-menu beginning first))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(texinfo-insert-menu new-menu-list node-name)))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-all-menus-update (&optional update-all-nodes-p)
|
|
|
|
|
"Update every regular menu in a Texinfo file.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
Update pre-existing master menu, if there is one.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2011-12-10 12:49:33 +02:00
|
|
|
|
Only single-file manuals are supported by this function. For
|
|
|
|
|
multi-file manuals, use `texinfo-multiple-files-update'.
|
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
If called with a non-nil argument, this function first updates all the
|
2011-12-10 12:49:33 +02:00
|
|
|
|
nodes in the buffer before updating the menus. Do NOT invoke this
|
|
|
|
|
command with an argument if your Texinfo file uses @node lines without
|
|
|
|
|
the `Next', `Previous', and `Up' pointers!
|
2002-02-20 17:39:38 +00:00
|
|
|
|
|
|
|
|
|
Indents the first line of descriptions, and leaves trailing whitespace
|
|
|
|
|
in a menu that lacks descriptions, so descriptions will format well.
|
|
|
|
|
In general, a menu should contain descriptions, because node names and
|
|
|
|
|
section titles are often too short to explain a node well."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(interactive "P")
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
master-menu-p)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(save-excursion
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(push-mark (point-max) t)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(message "Checking for a master menu in %s ... "(buffer-name))
|
|
|
|
|
(save-excursion
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when (search-forward texinfo-master-menu-header nil t)
|
|
|
|
|
;; Check if @detailmenu kludge is used;
|
|
|
|
|
;; if so, leave point before @detailmenu.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(search-backward "\n@detailmenu" (line-beginning-position -2) t)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Remove detailed master menu listing
|
|
|
|
|
(setq master-menu-p t)
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(let ((end-of-detailed-menu-descriptions
|
|
|
|
|
(save-excursion ; beginning of end menu line
|
|
|
|
|
(goto-char (texinfo-menu-end))
|
|
|
|
|
(beginning-of-line) (forward-char -1)
|
|
|
|
|
(point))))
|
|
|
|
|
(delete-region (point) end-of-detailed-menu-descriptions))))
|
|
|
|
|
|
|
|
|
|
(when update-all-nodes-p
|
|
|
|
|
(message "Updating all nodes in %s ... " (buffer-name))
|
|
|
|
|
(texinfo-update-node (point-min) (point-max)))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
|
|
|
|
(message "Updating all menus in %s ... " (buffer-name))
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(texinfo-make-menu (point-max) (point-min))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when master-menu-p
|
|
|
|
|
(message "Updating the master menu in %s... " (buffer-name))
|
|
|
|
|
(texinfo-master-menu nil)))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(message "Done...updated all the menus. You may save the buffer.")))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-find-lower-level-node (level region-end)
|
|
|
|
|
"Search forward from point for node at any level lower than LEVEL.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
Search is limited to the end of the marked region, REGION-END,
|
1990-10-20 02:38:04 +00:00
|
|
|
|
and to the end of the menu region for the level.
|
|
|
|
|
|
|
|
|
|
Return t if the node is found, else nil. Leave point at the beginning
|
|
|
|
|
of the node if one is found; else do not move point."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
2019-10-17 02:08:43 +02:00
|
|
|
|
(when (and (< (point) region-end)
|
|
|
|
|
(re-search-forward
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@node\\).*\n" ; match node line
|
|
|
|
|
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
|
|
|
|
(eval (cdr (assoc level texinfo-update-menu-lower-regexps))))
|
|
|
|
|
;; the next higher level node marks the end of this
|
|
|
|
|
;; section, and no lower level node will be found beyond
|
|
|
|
|
;; this position even if region-end is farther off
|
|
|
|
|
(texinfo-update-menu-region-end level)
|
|
|
|
|
t))
|
|
|
|
|
(goto-char (match-beginning 1))
|
|
|
|
|
t)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-find-higher-level-node (level region-end)
|
|
|
|
|
"Search forward from point for node at any higher level than argument LEVEL.
|
|
|
|
|
Search is limited to the end of the marked region, REGION-END.
|
|
|
|
|
|
|
|
|
|
Return t if the node is found, else nil. Leave point at the beginning
|
1998-10-11 12:47:19 +00:00
|
|
|
|
of the node if one is found; else do not move point.
|
|
|
|
|
|
|
|
|
|
A `@node' line starting at point does count as a match;
|
|
|
|
|
if the match is found there, the value is t and point does not move."
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(cond
|
2000-11-06 15:53:05 +00:00
|
|
|
|
((< level 3)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(if (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" region-end t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn (beginning-of-line) t)))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(t
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when (re-search-forward
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@node\\).*\n" ; match node line
|
|
|
|
|
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
|
|
|
|
(eval (cdr (assoc level texinfo-update-menu-higher-regexps))))
|
|
|
|
|
region-end t)
|
|
|
|
|
(beginning-of-line) t)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Making the list of new menu entries
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-make-menu-list (beginning end level)
|
|
|
|
|
"Make a list of node names and their descriptions.
|
|
|
|
|
Point is left at the end of the menu region, but the menu is not inserted.
|
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
First argument is position from which to start making menu list;
|
1990-10-20 02:38:04 +00:00
|
|
|
|
second argument is end of region in which to try to locate entries;
|
|
|
|
|
third argument is the level of the nodes that are the entries.
|
|
|
|
|
|
|
|
|
|
Node names and descriptions are dotted pairs of strings. Each pair is
|
|
|
|
|
an element of the list. If the description does not exist, the
|
|
|
|
|
element consists only of the node name."
|
|
|
|
|
(goto-char beginning)
|
|
|
|
|
(let (new-menu-list)
|
|
|
|
|
(while (texinfo-menu-locate-entry-p level end)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(push (cons
|
|
|
|
|
(texinfo-copy-node-name)
|
|
|
|
|
(prog1 "" (forward-line 1)))
|
|
|
|
|
;; Use following to insert section titles automatically.
|
|
|
|
|
;; (texinfo-copy-section-title))
|
|
|
|
|
new-menu-list))
|
|
|
|
|
(nreverse new-menu-list)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-menu-locate-entry-p (level search-end)
|
|
|
|
|
"Find a node that will be part of menu for this section.
|
|
|
|
|
First argument is a string such as \"section\" specifying the general
|
1993-07-07 22:15:20 +00:00
|
|
|
|
hierarchical level of the menu; second argument is a position
|
1990-10-20 02:38:04 +00:00
|
|
|
|
specifying the end of the search.
|
|
|
|
|
|
|
|
|
|
The function returns t if the node is found, else nil. It searches
|
|
|
|
|
forward from point, and leaves point at the beginning of the node.
|
|
|
|
|
|
|
|
|
|
The function finds entries of the same type. Thus `subsections' and
|
|
|
|
|
`unnumberedsubsecs' will appear in the same menu."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(if (re-search-forward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(concat
|
|
|
|
|
"\\(^@node\\).*\n" ; match node line
|
|
|
|
|
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
2001-08-16 17:59:38 +00:00
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-same-level-regexps))))
|
|
|
|
|
search-end
|
|
|
|
|
t)
|
|
|
|
|
(goto-char (match-beginning 1)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-copy-node-name ()
|
|
|
|
|
"Return the node name as a string.
|
|
|
|
|
|
|
|
|
|
Start with point at the beginning of the node line; copy the text
|
|
|
|
|
after the node command up to the first comma on the line, if any, and
|
|
|
|
|
return the text as a string. Leaves point at the beginning of the
|
|
|
|
|
line. If there is no node name, returns an empty string."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(buffer-substring
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(progn (forward-word-strictly 1) ; skip over node command
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t") ; and over spaces
|
|
|
|
|
(point))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(if (search-forward "," (line-end-position) t) ; bound search
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(1- (point))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(end-of-line) (point)))))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-copy-section-title ()
|
|
|
|
|
"Return the title of the section as a string.
|
|
|
|
|
The title is used as a description line in the menu when one does not
|
|
|
|
|
already exist.
|
|
|
|
|
|
|
|
|
|
Move point to the beginning of the appropriate section line by going
|
|
|
|
|
to the start of the text matched by last regexp searched for, which
|
|
|
|
|
must have been done by `texinfo-menu-locate-entry-p'."
|
|
|
|
|
|
|
|
|
|
;; could use the same re-search as in `texinfo-menu-locate-entry-p'
|
|
|
|
|
;; instead of using `match-beginning'; such a variation would be
|
|
|
|
|
;; more general, but would waste information already collected
|
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(goto-char (match-beginning 7)) ; match section name
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(buffer-substring
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(progn (forward-word-strictly 1) ; skip over section type
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t") ; and over spaces
|
|
|
|
|
(point))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(progn (end-of-line) (point))))
|
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Handling the old menu
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-old-menu-p (beginning first)
|
|
|
|
|
"Move point to the beginning of the menu for this section, if any.
|
|
|
|
|
Otherwise move point to the end of the first node of this section.
|
|
|
|
|
Return t if a menu is found, nil otherwise.
|
|
|
|
|
|
|
|
|
|
First argument is the position of the beginning of the section in which
|
|
|
|
|
the menu will be located; second argument is the position of the first
|
|
|
|
|
node within the section.
|
|
|
|
|
|
|
|
|
|
If no menu is found, the function inserts two newlines just before the
|
|
|
|
|
end of the section, and leaves point there where a menu ought to be."
|
|
|
|
|
(goto-char beginning)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(if (re-search-forward "^@menu" first 'goto-end)
|
|
|
|
|
t
|
|
|
|
|
(insert "\n\n") (forward-line -2) nil))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-incorporate-descriptions (new-menu-list)
|
|
|
|
|
"Copy the old menu line descriptions that exist to the new menu.
|
|
|
|
|
|
|
|
|
|
Point must be at beginning of old menu.
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
If the node-name of the new menu is found in the old menu, insert the
|
|
|
|
|
old description into the new entry.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
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
|
1993-07-07 22:15:20 +00:00
|
|
|
|
second element the description. The new menu is changed destructively.
|
1997-06-15 17:39:13 +00:00
|
|
|
|
The old menu is the menu as it appears in the Texinfo file."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((end-of-menu (texinfo-menu-end)))
|
|
|
|
|
(dolist (new-menu new-menu-list new-menu-list)
|
|
|
|
|
(save-excursion ; keep point at beginning of menu
|
|
|
|
|
(when (re-search-forward
|
|
|
|
|
;; Existing nodes can have the form
|
|
|
|
|
;; * NODE NAME:: DESCRIPTION
|
|
|
|
|
;; or
|
|
|
|
|
;; * MENU ITEM: NODE NAME. DESCRIPTION.
|
|
|
|
|
;;
|
|
|
|
|
;; Recognize both when looking for the description.
|
|
|
|
|
(concat "\\* \\(" ; so only menu entries are found
|
|
|
|
|
(regexp-quote (car new-menu)) "::"
|
|
|
|
|
"\\|"
|
|
|
|
|
".*: " (regexp-quote (car new-menu)) "[.,\t\n]"
|
|
|
|
|
"\\)"
|
|
|
|
|
) ; so only complete entries are found
|
|
|
|
|
end-of-menu
|
|
|
|
|
t)
|
|
|
|
|
(setcdr new-menu (texinfo-menu-copy-old-description end-of-menu)))))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(defun texinfo-incorporate-menu-entry-names (new-menu-list)
|
|
|
|
|
"Copy any old menu entry names to the new menu.
|
|
|
|
|
|
|
|
|
|
Point must be at beginning of old menu.
|
|
|
|
|
|
|
|
|
|
If the node-name of the new menu entry cannot be found in the old
|
|
|
|
|
menu, do nothing.
|
|
|
|
|
|
|
|
|
|
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 is the description (or nil).
|
|
|
|
|
|
|
|
|
|
If we find an existing menu entry name, we change the first element of
|
|
|
|
|
the pair to be another dotted pair in which the car is the menu entry
|
|
|
|
|
name and the cdr is the node name.
|
|
|
|
|
|
|
|
|
|
NEW-MENU-LIST is changed destructively. The old menu is the menu as it
|
|
|
|
|
appears in the texinfo file."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((end-of-menu (texinfo-menu-end)))
|
|
|
|
|
(dolist (new-menu new-menu-list new-menu-list)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(save-excursion ; keep point at beginning of menu
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(if (re-search-forward
|
|
|
|
|
;; Existing nodes can have the form
|
|
|
|
|
;; * NODE NAME:: DESCRIPTION
|
|
|
|
|
;; or
|
|
|
|
|
;; * MENU ITEM: NODE NAME. DESCRIPTION.
|
|
|
|
|
;;
|
|
|
|
|
;; We're interested in the second case.
|
|
|
|
|
(concat "\\* " ; so only menu entries are found
|
2001-10-28 03:24:14 +00:00
|
|
|
|
"\\(.*\\): " (regexp-quote (car new-menu))
|
1998-03-14 09:08:26 +00:00
|
|
|
|
"[.,\t\n]")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
end-of-menu
|
|
|
|
|
t)
|
|
|
|
|
(setcar
|
2001-10-28 03:24:14 +00:00
|
|
|
|
new-menu ; replace the node name
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(cons (buffer-substring (match-beginning 1) (match-end 1))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(car new-menu))))))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(defun texinfo-menu-copy-old-description (end-of-menu)
|
|
|
|
|
"Return description field of old menu line as string.
|
|
|
|
|
Point must be located just after the node name. Point left before description.
|
|
|
|
|
Single argument, END-OF-MENU, is position limiting search."
|
2019-03-19 18:45:17 -07:00
|
|
|
|
(skip-chars-forward ":.,\t\n ")
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; don't copy a carriage return at line beginning with asterisk!
|
2007-02-03 14:02:45 +00:00
|
|
|
|
;; don't copy @detailmenu or @end menu or @ignore as descriptions!
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; do copy a description that begins with an `@'!
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; !! Known bug: does not copy descriptions starting with ^|\{?* etc.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(if (and (looking-at "\\(\\w+\\|@\\)")
|
2007-02-03 14:02:45 +00:00
|
|
|
|
(not (looking-at
|
|
|
|
|
"\\(^\\* \\|^@detailmenu\\|^@end menu\\|^@ignore\\)")))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
(save-excursion
|
2007-02-03 14:02:45 +00:00
|
|
|
|
(re-search-forward "\\(^\\* \\|^@ignore\\|^@end menu\\)" end-of-menu t)
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(line-end-position 0))) ; end of last description line
|
1990-10-20 02:38:04 +00:00
|
|
|
|
""))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-menu-end ()
|
1997-06-15 17:39:13 +00:00
|
|
|
|
"Return position of end of menu, but don't move point.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
Signal an error if not end of menu."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if (re-search-forward "^@end menu" nil t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(point)
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Menu does not have an end"))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-delete-old-menu (beginning first)
|
|
|
|
|
"Delete the old menu. Point must be in or after menu.
|
|
|
|
|
First argument is position of the beginning of the section in which
|
|
|
|
|
the menu will be located; second argument is the position of the first
|
|
|
|
|
node within the section."
|
|
|
|
|
;; No third arg to search, so error if search fails.
|
|
|
|
|
(re-search-backward "^@menu" beginning)
|
|
|
|
|
(delete-region (point)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(re-search-forward "^@end menu" first)
|
|
|
|
|
(point))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Inserting new menu
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
;; try 32, but perhaps 24 is better
|
|
|
|
|
(defvar texinfo-column-for-description 32
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Column at which descriptions start in a Texinfo menu.")
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-insert-menu (menu-list node-name)
|
|
|
|
|
"Insert formatted menu at point.
|
2002-02-20 17:39:38 +00:00
|
|
|
|
Indents the first line of descriptions, if any, to the value of
|
|
|
|
|
texinfo-column-for-description. Indenting leaves trailing whitespace
|
|
|
|
|
in a menu that lacks descriptions, so descriptions will format well.
|
|
|
|
|
In general, a menu should contain descriptions, because node names and
|
|
|
|
|
section titles are often too short to explain a node well.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
MENU-LIST has form:
|
|
|
|
|
|
2015-09-17 16:08:20 -07:00
|
|
|
|
((\"node-name1\" . \"description\")
|
|
|
|
|
(\"node-name2\" . \"description\") ... )
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
However, the description field might be nil.
|
|
|
|
|
|
|
|
|
|
Also, the node-name field might itself be a dotted pair (call it P) of
|
|
|
|
|
strings instead of just a string. In that case, the car of P
|
|
|
|
|
is the menu entry name, and the cdr of P is the node name."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(insert "@menu\n")
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(dolist (menu menu-list)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Every menu entry starts with a star and a space.
|
|
|
|
|
(insert "* ")
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert the node name (and menu entry name, if present).
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((node-part (car menu)))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(if (stringp node-part)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; "Double colon" entry line; menu entry and node name are the same,
|
|
|
|
|
(insert (format "%s::" node-part))
|
|
|
|
|
;; "Single colon" entry line; menu entry and node name are different.
|
|
|
|
|
(insert (format "%s: %s." (car node-part) (cdr node-part)))))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert the description, if present.
|
2011-07-03 18:11:37 +02:00
|
|
|
|
(when (> (length (cdr menu)) 0)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Move to right place.
|
|
|
|
|
(indent-to texinfo-column-for-description 2)
|
|
|
|
|
;; Insert description.
|
|
|
|
|
(insert (format "%s" (cdr menu))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert "\n")) ; end this menu entry
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(insert "@end menu")
|
2002-03-03 17:30:07 +00:00
|
|
|
|
(let ((level (texinfo-hierarchic-level)))
|
|
|
|
|
(message
|
|
|
|
|
"Updated level \"%s\" menu following node: %s ... " level node-name)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Starting menu descriptions by inserting titles
|
|
|
|
|
|
|
|
|
|
(defun texinfo-start-menu-description ()
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"In this menu entry, insert the node's section title as a description.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
Position point at beginning of description ready for editing.
|
|
|
|
|
Do not insert a title if the line contains an existing description.
|
|
|
|
|
|
|
|
|
|
You will need to edit the inserted text since a useful description
|
|
|
|
|
complements the node name rather than repeats it as a title does."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(let (beginning end node-name title)
|
|
|
|
|
(save-excursion
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(beginning-of-line)
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(if (search-forward "* " (line-end-position) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn (skip-chars-forward " \t")
|
|
|
|
|
(setq beginning (point)))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "This is not a line in a menu"))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(cond
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; "Double colon" entry line; menu entry and node name are the same,
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
((search-forward "::" (line-end-position) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(if (looking-at "[ \t]*[^ \t\n]+")
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Descriptive text already exists"))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-backward ": \t")
|
|
|
|
|
(setq node-name (buffer-substring beginning (point))))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; "Single colon" entry line; menu entry and node name are different.
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
((search-forward ":" (line-end-position) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(setq beginning (point))
|
|
|
|
|
;; Menu entry line ends in a period, comma, or tab.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(if (re-search-forward "[.,\t]" (line-beginning-position 2) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(if (looking-at "[ \t]*[^ \t\n]+")
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Descriptive text already exists"))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-backward "., \t")
|
|
|
|
|
(setq node-name (buffer-substring beginning (point))))
|
|
|
|
|
;; Menu entry line ends in a return.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(re-search-forward ".*\n" (line-beginning-position 2) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-backward " \t\n")
|
|
|
|
|
(setq node-name (buffer-substring beginning (point)))
|
|
|
|
|
(if (= 0 (length node-name))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "No node name on this line")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(insert "."))))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(t (error "No node name on this line")))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Search for node that matches node name, and copy the section title.
|
|
|
|
|
(if (re-search-forward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(concat
|
|
|
|
|
"^@node[ \t]+"
|
|
|
|
|
(regexp-quote node-name)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
".*\n" ; match node line
|
1999-01-25 17:04:23 +00:00
|
|
|
|
"\\("
|
|
|
|
|
"\\(\\(^@c \\|^@comment\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
2001-08-16 17:59:38 +00:00
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
2002-03-01 16:02:42 +00:00
|
|
|
|
)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
nil t)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(setq title
|
|
|
|
|
(buffer-substring
|
|
|
|
|
;; skip over section type
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(progn (forward-word-strictly 1)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; and over spaces
|
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(point))
|
|
|
|
|
(progn (end-of-line)
|
|
|
|
|
(skip-chars-backward " \t")
|
|
|
|
|
(point))))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Cannot find node to match node name in menu entry")))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Return point to the menu and insert the title.
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(delete-region
|
|
|
|
|
(point)
|
|
|
|
|
(save-excursion (skip-chars-backward " \t") (point)))
|
|
|
|
|
(indent-to texinfo-column-for-description 2)
|
|
|
|
|
(save-excursion (insert title))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Handling description indentation
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; Since the make-menu functions indent descriptions, these functions
|
|
|
|
|
;; are useful primarily for indenting a single menu specially.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-indent-menu-description (column &optional region-p)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"Indent every description in menu following point to COLUMN.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
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."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(interactive
|
|
|
|
|
"nIndent menu descriptions to (column number): \nP")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(if (not region-p)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(re-search-forward "^@menu")
|
|
|
|
|
(texinfo-menu-indent-description column)
|
|
|
|
|
(message
|
|
|
|
|
"Indented descriptions in menu. You may save the buffer."))
|
|
|
|
|
;;else
|
|
|
|
|
(message "Indenting every menu description in region... ")
|
|
|
|
|
(goto-char (region-beginning))
|
|
|
|
|
(while (and (< (point) (region-end))
|
|
|
|
|
(texinfo-locate-menu-p))
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(texinfo-menu-indent-description column))
|
|
|
|
|
(message "Indenting done. You may save the buffer.")))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-menu-indent-description (to-column-number)
|
|
|
|
|
"Indent the Texinfo file menu description to TO-COLUMN-NUMBER.
|
|
|
|
|
Start with point just after the word `menu' in the `@menu' line and
|
|
|
|
|
leave point on the line before the `@end menu' line. Does not indent
|
|
|
|
|
second and subsequent lines of a multi-line description."
|
|
|
|
|
(let* ((beginning-of-next-line (point)))
|
|
|
|
|
(while (< beginning-of-next-line
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(save-excursion ; beginning of end menu line
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(goto-char (texinfo-menu-end))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(point)))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when (re-search-forward "\\* \\(.*::\\|.*: [^.,\t\n]+[.,\t]\\)"
|
|
|
|
|
(texinfo-menu-end)
|
|
|
|
|
t)
|
|
|
|
|
(let ((beginning-white-space (point)))
|
|
|
|
|
(skip-chars-forward " \t") ; skip over spaces
|
|
|
|
|
(if (looking-at "\\(@\\|\\w\\)+") ; if there is text
|
|
|
|
|
(progn
|
|
|
|
|
;; remove pre-existing indentation
|
|
|
|
|
(delete-region beginning-white-space (point))
|
|
|
|
|
(indent-to-column to-column-number)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; position point at beginning of next line
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(forward-line 1)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(setq beginning-of-next-line (point)))))
|
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Making the master menu
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-master-menu (update-all-nodes-menus-p)
|
|
|
|
|
"Make a master menu for a whole Texinfo file.
|
2011-12-10 12:49:33 +02:00
|
|
|
|
Remove pre-existing master menu, if there is one.
|
|
|
|
|
|
|
|
|
|
This function supports only single-file manuals. For multi-file
|
|
|
|
|
manuals, use `texinfo-multiple-files-update'.
|
|
|
|
|
|
2011-12-10 14:22:25 +02:00
|
|
|
|
This function creates or updates the @detailmenu section of a
|
|
|
|
|
master menu that follows the Top node. It replaces any existing
|
|
|
|
|
detailed menu that follows the top node. The detailed menu
|
|
|
|
|
includes every entry from all the other menus. By default, the
|
|
|
|
|
existing menus, including the menu in the Top node, are not
|
|
|
|
|
updated according to the buffer contents, so all the menus should
|
|
|
|
|
be updated first using `texinfo-make-menu' or
|
|
|
|
|
`texinfo-all-menus-update', which see. Alternatively, invoke
|
|
|
|
|
this function with a prefix argument, see below.
|
|
|
|
|
|
2011-12-10 12:49:33 +02:00
|
|
|
|
Non-nil, non-numeric argument (C-u prefix, if interactive) means
|
|
|
|
|
first update all existing menus in the buffer (incorporating
|
|
|
|
|
descriptions from pre-existing menus) before it constructs the
|
|
|
|
|
master menu. If the argument is numeric (e.g., \"C-u 2\"),
|
|
|
|
|
update all existing nodes as well, by calling
|
2015-06-30 15:06:31 -07:00
|
|
|
|
`texinfo-update-node' on the entire file. Warning: do NOT
|
2011-12-10 12:49:33 +02:00
|
|
|
|
invoke with a numeric argument if your Texinfo file uses @node
|
|
|
|
|
lines without the `Next', `Previous', `Up' pointers, as the
|
|
|
|
|
result could be an invalid Texinfo file!
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2011-12-10 14:22:25 +02:00
|
|
|
|
The function removes and recreates the detailed part of an already
|
|
|
|
|
existing master menu. This action assumes that the pre-existing
|
|
|
|
|
master menu uses the standard `texinfo-master-menu-header' for the
|
|
|
|
|
detailed menu.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
The master menu has the following format, which is adapted from the
|
|
|
|
|
recommendation in the Texinfo Manual:
|
|
|
|
|
|
|
|
|
|
* The first part contains the major nodes in the Texinfo file: the
|
|
|
|
|
nodes for the chapters, chapter-like sections, and the major
|
|
|
|
|
appendices. This includes the indices, so long as they are in
|
|
|
|
|
chapter-like sections, such as unnumbered sections.
|
|
|
|
|
|
|
|
|
|
* The second and subsequent parts contain a listing of the other,
|
|
|
|
|
lower level menus, in order. This way, an inquirer can go
|
|
|
|
|
directly to a particular node if he or she is searching for
|
|
|
|
|
specific information.
|
|
|
|
|
|
|
|
|
|
Each of the menus in the detailed node listing is introduced by the
|
2002-02-20 17:39:38 +00:00
|
|
|
|
title of the section containing the menu.
|
|
|
|
|
|
|
|
|
|
Indents the first line of descriptions, and leaves trailing whitespace
|
|
|
|
|
in a menu that lacks descriptions, so descriptions will format well.
|
|
|
|
|
In general, a menu should contain descriptions, because node names and
|
|
|
|
|
section titles are often too short to explain a node well."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(interactive "P")
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Move point to location after `top'.
|
|
|
|
|
(if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "This buffer needs a Top node"))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
|
|
|
|
(let ((first-chapter
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(or (re-search-forward "^@node" nil t)
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Too few nodes for a master menu"))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(point))))
|
1997-07-18 02:57:14 +00:00
|
|
|
|
(if (search-forward texinfo-master-menu-header first-chapter t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
;; Check if @detailmenu kludge is used;
|
|
|
|
|
;; if so, leave point before @detailmenu.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(search-backward "\n@detailmenu" (line-beginning-position -2) t)
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; Remove detailed master menu listing
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(let ((end-of-detailed-menu-descriptions
|
|
|
|
|
(save-excursion ; beginning of end menu line
|
|
|
|
|
(goto-char (texinfo-menu-end))
|
|
|
|
|
(beginning-of-line) (forward-char -1)
|
|
|
|
|
(point))))
|
|
|
|
|
(delete-region (point) end-of-detailed-menu-descriptions)))))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(if update-all-nodes-menus-p
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
2011-12-10 12:49:33 +02:00
|
|
|
|
(when (numberp update-all-nodes-menus-p)
|
|
|
|
|
(message
|
|
|
|
|
"Making a master menu in %s ...first updating all nodes... "
|
|
|
|
|
(buffer-name))
|
|
|
|
|
(texinfo-update-node (point-min) (point-max)))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(message "Updating all menus in %s ... " (buffer-name))
|
|
|
|
|
(texinfo-make-menu (point-min) (point-max))))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(message "Now making the master menu in %s... " (buffer-name))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(goto-char (point-min))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(texinfo-insert-master-menu-list
|
|
|
|
|
(texinfo-master-menu-list))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Remove extra newlines that texinfo-insert-master-menu-list
|
|
|
|
|
;; may have inserted.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-07-18 02:57:14 +00:00
|
|
|
|
(if (search-forward texinfo-master-menu-header nil t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
;; Check if @detailmenu kludge is used;
|
|
|
|
|
;; if so, leave point before @detailmenu.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(search-backward "\n@detailmenu" (line-beginning-position -2) t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(insert "\n")
|
|
|
|
|
(delete-blank-lines)
|
|
|
|
|
(goto-char (point-min))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
|
|
|
|
(re-search-forward "^@menu")
|
|
|
|
|
(forward-line -1)
|
|
|
|
|
(delete-blank-lines)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(re-search-forward "^@end menu")
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(delete-blank-lines))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(message
|
|
|
|
|
"Done...completed making master menu. You may save the buffer.")))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-master-menu-list ()
|
|
|
|
|
"Return a list of menu entries and header lines for the master menu.
|
|
|
|
|
|
|
|
|
|
Start with the menu for chapters and indices and then find each
|
|
|
|
|
following menu and the title of the node preceding that menu.
|
|
|
|
|
|
|
|
|
|
The master menu list has this form:
|
|
|
|
|
|
2015-09-17 16:08:20 -07:00
|
|
|
|
(((... \"entry-1-2\" \"entry-1\") \"title-1\")
|
|
|
|
|
((... \"entry-2-2\" \"entry-2-1\") \"title-2\")
|
|
|
|
|
...)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
However, there does not need to be a title field."
|
|
|
|
|
|
|
|
|
|
(let (master-menu-list)
|
|
|
|
|
(while (texinfo-locate-menu-p)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(push (list (texinfo-copy-menu) (texinfo-copy-menu-title))
|
|
|
|
|
master-menu-list))
|
|
|
|
|
(nreverse master-menu-list)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-insert-master-menu-list (master-menu-list)
|
|
|
|
|
"Format and insert the master menu in the current buffer."
|
|
|
|
|
(goto-char (point-min))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert a master menu only after `Top' node and before next node
|
2015-09-17 16:08:20 -07:00
|
|
|
|
;; (or include file if there is no next node).
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(unless (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t)
|
|
|
|
|
(error "This buffer needs a Top node"))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((first-chapter
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(save-excursion (re-search-forward "^@node\\|^@include") (point))))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(unless (re-search-forward "^@menu" first-chapter t)
|
2011-12-10 14:22:25 +02:00
|
|
|
|
(error "Buffer lacks a menu in its first node; create it, then run me again")))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(beginning-of-line)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(delete-region ; buffer must have ordinary top menu
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(point)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(save-excursion (re-search-forward "^@end menu") (point)))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; `master-menu-inserted-p' is a kludge to tell
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; whether to insert @end detailmenu (see bleow)
|
|
|
|
|
(let (master-menu-inserted-p)
|
|
|
|
|
;; Handle top of menu
|
|
|
|
|
(insert "\n@menu\n")
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Insert chapter menu entries. Tell user what is going on.
|
|
|
|
|
(message "Inserting chapter menu entry: %s ... "
|
|
|
|
|
(car (car master-menu-list)))
|
|
|
|
|
(dolist (entry (reverse (car (car master-menu-list))))
|
|
|
|
|
(insert "* " entry "\n"))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
(setq master-menu-list (cdr master-menu-list))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; Only insert detailed master menu if there is one....
|
|
|
|
|
(if (car (car master-menu-list))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn (setq master-menu-inserted-p t)
|
|
|
|
|
(insert (concat "\n@detailmenu\n"
|
1998-06-08 06:12:50 +00:00
|
|
|
|
texinfo-master-menu-header))))
|
1997-06-15 17:39:13 +00:00
|
|
|
|
|
|
|
|
|
;; @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
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; The menu master-menu-list has a form like this:
|
|
|
|
|
;; ((("beta" "alpha") "title-A")
|
|
|
|
|
;; (("delta" "gamma") "title-B"))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(dolist (menu master-menu-list)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(message "Inserting menu for %s .... " (cadr menu))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; insert title of menu section
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert "\n" (cadr menu) "\n\n")
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; insert each menu entry
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(dolist (entry (reverse (car menu)))
|
|
|
|
|
(insert "* " entry "\n")))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; Finish menu
|
|
|
|
|
|
|
|
|
|
;; @detailmenu (see note above)
|
|
|
|
|
;; Only insert @end detailmenu if a master menu was inserted.
|
|
|
|
|
(if master-menu-inserted-p
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(insert "\n@end detailmenu"))
|
1997-06-15 17:39:13 +00:00
|
|
|
|
(insert "\n@end menu\n\n"))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-locate-menu-p ()
|
|
|
|
|
"Find the next menu in the texinfo file.
|
|
|
|
|
If found, leave point after word `menu' on the `@menu' line, and return t.
|
|
|
|
|
If a menu is not found, do not move point and return nil."
|
|
|
|
|
(re-search-forward "\\(^@menu\\)" nil t))
|
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(defun texinfo-copy-menu-title ()
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Return the title of the section preceding the menu as a string.
|
|
|
|
|
If such a title cannot be found, return an empty string. Do not move
|
|
|
|
|
point."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if (re-search-backward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(concat
|
|
|
|
|
"\\(^@top"
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
texinfo-section-types-regexp ; all other section types
|
|
|
|
|
"\\)")
|
|
|
|
|
nil
|
|
|
|
|
t)
|
|
|
|
|
(progn
|
|
|
|
|
(beginning-of-line)
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1) ; skip over section type
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t") ; and over spaces
|
|
|
|
|
(buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
(progn (end-of-line) (point))))
|
|
|
|
|
""))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-copy-menu ()
|
|
|
|
|
"Return the entries of an existing menu as a list.
|
|
|
|
|
Start with point just after the word `menu' in the `@menu' line
|
|
|
|
|
and leave point on the line before the `@end menu' line."
|
|
|
|
|
(let* (this-menu-list
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(end-of-menu (texinfo-menu-end)) ; position of end of `@end menu'
|
|
|
|
|
(last-entry (save-excursion ; position of beginning of
|
|
|
|
|
; last `* ' entry
|
|
|
|
|
(goto-char end-of-menu)
|
|
|
|
|
;; handle multi-line description
|
|
|
|
|
(if (not (re-search-backward "^\\* " nil t))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "No entries in menu"))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(point))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(while (< (point) last-entry)
|
1996-06-09 13:42:55 +00:00
|
|
|
|
(if (re-search-forward "^\\* " end-of-menu t)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(push (buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
;; copy multi-line descriptions
|
|
|
|
|
(save-excursion
|
|
|
|
|
(re-search-forward "\\(^\\* \\|^@e\\)" nil t)
|
|
|
|
|
(- (point) 3)))
|
|
|
|
|
this-menu-list)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
this-menu-list))
|
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Determining the hierarchical level in the texinfo file
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(defun texinfo-specific-section-type ()
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Return the specific type of next section, as a string.
|
|
|
|
|
For example, \"unnumberedsubsec\". Return \"top\" for top node.
|
|
|
|
|
|
|
|
|
|
Searches forward for a section. Hence, point must be before the
|
|
|
|
|
section whose type will be found. Does not move point. Signal an
|
|
|
|
|
error if the node is not the top node and a section is not found."
|
2014-08-21 18:07:13 +03:00
|
|
|
|
(let* ((case-fold-search t)
|
|
|
|
|
;; The Texinfo manual has a second Top node inside @verbatim
|
|
|
|
|
;; near the end, which dupes us into thinking we are at top
|
|
|
|
|
;; level, no matter where we are when invoked. We don't
|
|
|
|
|
;; really grok @verbatim, so we cheat: only consider us to be
|
|
|
|
|
;; at top level if the position of the Top node we found is
|
|
|
|
|
;; before any other sectioning command.
|
|
|
|
|
(top-pos (save-excursion
|
|
|
|
|
(re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)"
|
|
|
|
|
;; Following search limit causes a bug
|
|
|
|
|
;;(line-end-position)
|
|
|
|
|
nil
|
|
|
|
|
t)))
|
|
|
|
|
(sec-pos (save-excursion
|
|
|
|
|
(re-search-forward texinfo-section-types-regexp nil t)))
|
|
|
|
|
sec-name)
|
|
|
|
|
(if sec-pos
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char sec-pos)
|
|
|
|
|
(setq sec-name (buffer-substring-no-properties
|
|
|
|
|
(progn (beginning-of-line) ; copy its name
|
|
|
|
|
(1+ (point)))
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(progn (forward-word-strictly 1)
|
2014-08-21 18:07:13 +03:00
|
|
|
|
(point))))))
|
|
|
|
|
(cond
|
|
|
|
|
((or sec-pos top-pos)
|
|
|
|
|
(if (and top-pos sec-pos)
|
|
|
|
|
(if (< top-pos sec-pos)
|
|
|
|
|
"top"
|
|
|
|
|
sec-name)
|
|
|
|
|
(or sec-name "top")))
|
|
|
|
|
(t
|
|
|
|
|
(error
|
|
|
|
|
"texinfo-specific-section-type: Chapter or section not found")))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-hierarchic-level ()
|
2011-12-18 22:21:24 -08:00
|
|
|
|
"Return the general hierarchical level of the next node in a texinfo file.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
Thus, a subheading or appendixsubsec is of type subsection."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
2000-11-06 15:53:05 +00:00
|
|
|
|
(cadr (assoc
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(texinfo-specific-section-type)
|
|
|
|
|
texinfo-section-list))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Locating the major positions
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(defun texinfo-update-menu-region-beginning (level)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Locate beginning of higher level section this section is within.
|
|
|
|
|
Return position of the beginning of the node line; do not move point.
|
|
|
|
|
Thus, if this level is subsection, searches backwards for section node.
|
|
|
|
|
Only argument is a string of the general type of section."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
;; !! Known bug: if section immediately follows top node, this
|
|
|
|
|
;; returns the beginning of the buffer as the beginning of the
|
|
|
|
|
;; higher level section.
|
|
|
|
|
(cond
|
2000-11-06 15:53:05 +00:00
|
|
|
|
((< level 3)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(save-excursion
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t)
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(line-beginning-position)))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(t
|
|
|
|
|
(save-excursion
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(re-search-backward
|
|
|
|
|
(concat
|
|
|
|
|
"\\(^@node\\).*\n" ; match node line
|
|
|
|
|
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
2001-08-16 17:59:38 +00:00
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-higher-regexps))))
|
|
|
|
|
nil
|
|
|
|
|
'goto-beginning)
|
|
|
|
|
(point))))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(defun texinfo-update-menu-region-end (level)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Locate end of higher level section this section is within.
|
|
|
|
|
Return position; do not move point. Thus, if this level is a
|
|
|
|
|
subsection, find the node for the section this subsection is within.
|
|
|
|
|
If level is top or chapter, returns end of file. Only argument is a
|
|
|
|
|
string of the general type of section."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if (re-search-forward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(concat
|
|
|
|
|
"\\(^@node\\).*\n" ; match node line
|
|
|
|
|
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
|
|
|
|
|
"\\|" ; or
|
2001-08-16 17:59:38 +00:00
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
|
|
|
|
|
"\\|" ; or
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
|
|
|
|
|
"\\)?" ; end of expression
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
;; Never finds end of level above chapter so goes to end.
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-higher-regexps))))
|
|
|
|
|
nil
|
|
|
|
|
'goto-end)
|
|
|
|
|
(match-beginning 1)
|
|
|
|
|
(point-max)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-menu-first-node (beginning end)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"Locate first node of the section the menu will be placed in.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
Return position; do not move point.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
The menu will be located just before this position.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
First argument is the position of the beginning of the section in
|
|
|
|
|
which the menu will be located; second argument is the position of the
|
|
|
|
|
end of that region; it limits the search."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char beginning)
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(re-search-forward "^@node" end t)
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(line-beginning-position)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Updating a node
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(defun texinfo-update-node (&optional beginning end)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Without any prefix argument, update the node in which point is located.
|
1997-04-05 21:59:09 +00:00
|
|
|
|
Interactively, a prefix argument means to operate on the region.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2011-12-10 12:49:33 +02:00
|
|
|
|
Warning: do NOT use this function if your Texinfo file uses @node
|
|
|
|
|
lines without the `Next', `Previous', `Up' pointers, because the
|
|
|
|
|
result could be an invalid Texinfo file due to known deficiencies
|
|
|
|
|
in this command: it does not support @ignore and @if* directives.
|
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
The functions for creating or updating nodes and menus, and their
|
|
|
|
|
keybindings, are:
|
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
texinfo-update-node (&optional beginning end) \\[texinfo-update-node]
|
1990-10-20 02:38:04 +00:00
|
|
|
|
texinfo-every-node-update () \\[texinfo-every-node-update]
|
|
|
|
|
texinfo-sequential-node-update (&optional region-p)
|
|
|
|
|
|
|
|
|
|
texinfo-make-menu (&optional region-p) \\[texinfo-make-menu]
|
|
|
|
|
texinfo-all-menus-update () \\[texinfo-all-menus-update]
|
|
|
|
|
texinfo-master-menu ()
|
|
|
|
|
|
|
|
|
|
texinfo-indent-menu-description (column &optional region-p)
|
|
|
|
|
|
|
|
|
|
The `texinfo-column-for-description' variable specifies the column to
|
1993-07-07 22:15:20 +00:00
|
|
|
|
which menu descriptions are indented. Its default value is 32."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(interactive
|
|
|
|
|
(if prefix-arg
|
|
|
|
|
(list (point) (mark))))
|
|
|
|
|
(if (null beginning)
|
|
|
|
|
;; Update a single node.
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((auto-fill-function nil))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(if (not (re-search-backward "^@node" (point-min) t))
|
|
|
|
|
(error "Node line not found before this position"))
|
|
|
|
|
(texinfo-update-the-node)
|
|
|
|
|
(message "Done...updated the node. You may save the buffer."))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; else
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((auto-fill-function nil))
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region beginning end)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward "^@node" (point-max) t)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(beginning-of-line)
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(texinfo-update-the-node))
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(message "Done...nodes updated in region. You may save the buffer."))))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-every-node-update ()
|
2011-12-10 12:49:33 +02:00
|
|
|
|
"Update every node in a Texinfo file.
|
|
|
|
|
|
|
|
|
|
Warning: do NOT use this function if your Texinfo file uses @node
|
|
|
|
|
lines without the `Next', `Previous', `Up' pointers, because the
|
|
|
|
|
result could be an invalid Texinfo file due to known deficiencies
|
|
|
|
|
in this command: it does not support @ignore and @if* directives."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(save-excursion
|
1997-04-05 21:59:09 +00:00
|
|
|
|
(texinfo-update-node (point-min) (point-max))
|
2001-08-20 10:36:41 +00:00
|
|
|
|
(message "Done...updated every node. You may save the buffer.")))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-update-the-node ()
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"Update one node. Point must be at the beginning of node line.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
Leave point at the end of the node line."
|
|
|
|
|
(texinfo-check-for-node-name)
|
|
|
|
|
(texinfo-delete-existing-pointers)
|
|
|
|
|
(message "Updating node: %s ... " (texinfo-copy-node-name))
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(let*
|
1999-01-25 17:04:23 +00:00
|
|
|
|
((case-fold-search t)
|
|
|
|
|
(level (texinfo-hierarchic-level))
|
|
|
|
|
(beginning (texinfo-update-menu-region-beginning level))
|
|
|
|
|
(end (texinfo-update-menu-region-end level)))
|
2000-11-06 15:53:05 +00:00
|
|
|
|
(if (eq level 1)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(texinfo-top-pointer-case)
|
|
|
|
|
;; else
|
|
|
|
|
(texinfo-insert-pointer beginning end level 'next)
|
|
|
|
|
(texinfo-insert-pointer beginning end level 'previous)
|
|
|
|
|
(texinfo-insert-pointer beginning end level 'up)
|
|
|
|
|
(texinfo-clean-up-node-line)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-top-pointer-case ()
|
|
|
|
|
"Insert pointers in the Top node. This is a special case.
|
|
|
|
|
|
|
|
|
|
The `Next' pointer is a pointer to a chapter or section at a lower
|
|
|
|
|
hierarchical level in the file. The `Previous' and `Up' pointers are
|
|
|
|
|
to `(dir)'. Point must be at the beginning of the node line, and is
|
|
|
|
|
left at the end of the node line."
|
|
|
|
|
|
|
|
|
|
(texinfo-clean-up-node-line)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(insert ", "
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
;; There may be an @chapter or other such command between
|
|
|
|
|
;; the top node line and the next node line, as a title
|
|
|
|
|
;; for an `ifinfo' section. This @chapter command must
|
|
|
|
|
;; must be skipped. So the procedure is to search for
|
|
|
|
|
;; the next `@node' line, and then copy its name.
|
|
|
|
|
(if (re-search-forward "^@node" nil t)
|
|
|
|
|
(progn
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-copy-node-name))
|
|
|
|
|
" "))
|
|
|
|
|
", (dir), (dir)"))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-check-for-node-name ()
|
|
|
|
|
"Determine whether the node has a node name. Prompt for one if not.
|
|
|
|
|
Point must be at beginning of node line. Does not move point."
|
|
|
|
|
(save-excursion
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((initial (texinfo-copy-next-section-title)))
|
|
|
|
|
;; This is not clean. Use `interactive' to read the arg.
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1) ; skip over node command
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(skip-chars-forward " \t") ; and over spaces
|
|
|
|
|
(if (not (looking-at "[^,\t\n ]+")) ; regexp based on what Info looks for
|
1999-01-25 17:04:23 +00:00
|
|
|
|
; alternatively, use "[a-zA-Z]+"
|
|
|
|
|
(let ((node-name
|
|
|
|
|
(read-from-minibuffer
|
|
|
|
|
"Node name (use no @, commas, colons, or apostrophes): "
|
|
|
|
|
initial)))
|
|
|
|
|
(insert " " node-name))))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-delete-existing-pointers ()
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"Delete `Next', `Previous', and `Up' pointers.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
Starts from the current position of the cursor, and searches forward
|
|
|
|
|
on the line for a comma and if one is found, deletes the rest of the
|
|
|
|
|
line, including the comma. Leaves point at beginning of line."
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(let ((eol-point (line-end-position)))
|
1995-05-26 04:00:52 +00:00
|
|
|
|
(if (search-forward "," eol-point t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(delete-region (1- (point)) eol-point)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(beginning-of-line))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-find-pointer (beginning end level direction)
|
|
|
|
|
"Move point to section associated with next, previous, or up pointer.
|
1997-06-15 17:39:13 +00:00
|
|
|
|
Return type of pointer (either `normal' or `no-pointer').
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
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 a string specifying the general kind
|
1996-06-09 13:40:05 +00:00
|
|
|
|
of section such as \"chapter\" or \"section\". When looking for the
|
1990-10-20 02:38:04 +00:00
|
|
|
|
`Next' pointer, the section found will be at the same hierarchical
|
|
|
|
|
level in the Texinfo file; when looking for the `Previous' pointer,
|
|
|
|
|
the section found will be at the same or higher hierarchical level in
|
|
|
|
|
the Texinfo file; when looking for the `Up' pointer, the section found
|
|
|
|
|
will be at some level higher in the Texinfo file. The fourth argument
|
2015-09-17 16:08:20 -07:00
|
|
|
|
\(one of `next', `previous', or `up') specifies whether to find the
|
1990-10-20 02:38:04 +00:00
|
|
|
|
`Next', `Previous', or `Up' pointer."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(cond ((eq direction 'next)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(forward-line 3) ; skip over current node
|
|
|
|
|
;; Search for section commands accompanied by node lines;
|
|
|
|
|
;; ignore section commands in the middle of nodes.
|
|
|
|
|
(if (re-search-forward
|
2001-08-16 17:59:38 +00:00
|
|
|
|
;; A `Top' node is never a next pointer, so won't find it.
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(concat
|
|
|
|
|
;; Match node line.
|
|
|
|
|
"\\(^@node\\).*\n"
|
2001-08-16 17:59:38 +00:00
|
|
|
|
;; Match comment, ifinfo, ifnottex line, if any
|
|
|
|
|
(concat
|
|
|
|
|
"\\(\\("
|
|
|
|
|
"\\(^@c\\).*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)"
|
|
|
|
|
"\\)?")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-same-level-regexps))))
|
|
|
|
|
end
|
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
((eq direction 'previous)
|
|
|
|
|
(if (re-search-backward
|
|
|
|
|
(concat
|
|
|
|
|
"\\("
|
|
|
|
|
;; Match node line.
|
|
|
|
|
"\\(^@node\\).*\n"
|
2001-08-16 17:59:38 +00:00
|
|
|
|
;; Match comment, ifinfo, ifnottex line, if any
|
|
|
|
|
(concat
|
|
|
|
|
"\\(\\("
|
|
|
|
|
"\\(^@c\\).*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)"
|
|
|
|
|
"\\)?")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-same-level-regexps)))
|
|
|
|
|
"\\|"
|
|
|
|
|
;; Match node line.
|
|
|
|
|
"\\(^@node\\).*\n"
|
2001-08-16 17:59:38 +00:00
|
|
|
|
;; Match comment, ifinfo, ifnottex line, if any
|
|
|
|
|
(concat
|
|
|
|
|
"\\(\\("
|
|
|
|
|
"\\(^@c\\).*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)"
|
|
|
|
|
"\\)?")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval
|
|
|
|
|
(cdr (assoc level texinfo-update-menu-higher-regexps)))
|
|
|
|
|
"\\|"
|
|
|
|
|
;; Handle `Top' node specially.
|
|
|
|
|
"^@node [ \t]*top[ \t]*\\(,\\|$\\)"
|
|
|
|
|
"\\)")
|
|
|
|
|
beginning
|
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
((eq direction 'up)
|
|
|
|
|
(if (re-search-backward
|
|
|
|
|
(concat
|
|
|
|
|
"\\("
|
|
|
|
|
;; Match node line.
|
|
|
|
|
"\\(^@node\\).*\n"
|
2001-08-16 17:59:38 +00:00
|
|
|
|
;; Match comment, ifinfo, ifnottex line, if any
|
|
|
|
|
(concat
|
|
|
|
|
"\\(\\("
|
|
|
|
|
"\\(^@c\\).*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifinfo[ ]*\n\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(^@ifnottex[ ]*\n\\)"
|
|
|
|
|
"\\)?")
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(eval (cdr (assoc level texinfo-update-menu-higher-regexps)))
|
|
|
|
|
"\\|"
|
|
|
|
|
;; Handle `Top' node specially.
|
|
|
|
|
"^@node [ \t]*top[ \t]*\\(,\\|$\\)"
|
|
|
|
|
"\\)")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char beginning)
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(line-beginning-position))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
(t
|
|
|
|
|
(error "texinfo-find-pointer: lack proper arguments")))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-pointer-name (kind)
|
|
|
|
|
"Return the node name preceding the section command.
|
1997-06-15 17:39:13 +00:00
|
|
|
|
The argument is the kind of section, either `normal' or `no-pointer'."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(let (name)
|
|
|
|
|
(cond ((eq kind 'normal)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(end-of-line) ; this handles prev node top case
|
|
|
|
|
(re-search-backward ; when point is already
|
|
|
|
|
"^@node" ; at the beginning of @node line
|
2010-11-09 23:59:00 -08:00
|
|
|
|
(line-beginning-position -2)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
t)
|
|
|
|
|
(setq name (texinfo-copy-node-name)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
((eq kind 'no-pointer)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; Don't need to put a blank in the pointer slot,
|
|
|
|
|
;; since insert "' " always has a space
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(setq name " "))) ; put a blank in the pointer slot
|
|
|
|
|
name))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-insert-pointer (beginning end level direction)
|
|
|
|
|
"Insert the `Next', `Previous' or `Up' node name at point.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
Move point forward.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
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
|
1997-06-15 17:39:13 +00:00
|
|
|
|
towards which the pointer is directed, one of `next', `previous', or `up'."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(insert
|
|
|
|
|
", "
|
|
|
|
|
(save-excursion
|
|
|
|
|
(texinfo-pointer-name
|
|
|
|
|
(texinfo-find-pointer beginning end level direction)))))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-clean-up-node-line ()
|
|
|
|
|
"Remove extra commas, if any, at end of node line."
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(skip-chars-backward ", ")
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(delete-region (point) (line-end-position)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Updating nodes sequentially
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; These sequential update functions insert `Next' or `Previous'
|
|
|
|
|
;; pointers that point to the following or preceding nodes even if they
|
|
|
|
|
;; are at higher or lower hierarchical levels. This means that if a
|
|
|
|
|
;; section contains one or more subsections, the section's `Next'
|
|
|
|
|
;; pointer will point to the subsection and not the following section.
|
|
|
|
|
;; (The subsection to which `Next' points will most likely be the first
|
|
|
|
|
;; item on the section's menu.)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-sequential-node-update (&optional region-p)
|
|
|
|
|
"Update one node (or many) in a Texinfo file with sequential pointers.
|
|
|
|
|
|
|
|
|
|
This function causes the `Next' or `Previous' pointer to point to the
|
|
|
|
|
immediately preceding or following node, even if it is at a higher or
|
|
|
|
|
lower hierarchical level in the document. Continually pressing `n' or
|
|
|
|
|
`p' takes you straight through the file.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
This command makes it awkward to navigate among sections and
|
|
|
|
|
subsections; it should be used only for those documents that are meant
|
|
|
|
|
to be read like a novel rather than a reference, and for which the
|
|
|
|
|
Info `g*' command is inadequate."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(if (not region-p)
|
1993-07-07 22:21:19 +00:00
|
|
|
|
;; update a single node
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((auto-fill-function nil))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(if (not (re-search-backward "^@node" (point-min) t))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Node line not found before this position"))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(texinfo-sequentially-update-the-node)
|
|
|
|
|
(message
|
|
|
|
|
"Done...sequentially updated the node . You may save the buffer."))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; else
|
1992-06-30 13:54:21 +00:00
|
|
|
|
(let ((auto-fill-function nil)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(beginning (region-beginning))
|
|
|
|
|
(end (region-end)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(if (= end beginning)
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "Please mark a region"))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(save-restriction
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(narrow-to-region beginning end)
|
|
|
|
|
(goto-char beginning)
|
|
|
|
|
(push-mark (point) t)
|
|
|
|
|
(while (re-search-forward "^@node" (point-max) t)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-sequentially-update-the-node))
|
|
|
|
|
(message
|
|
|
|
|
"Done...updated the nodes in sequence. You may save the buffer.")))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-sequentially-update-the-node ()
|
1997-08-04 01:11:01 +00:00
|
|
|
|
"Update one node such that the pointers are sequential.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
A `Next' or `Previous' pointer points to any preceding or following node,
|
|
|
|
|
regardless of its hierarchical level."
|
|
|
|
|
|
2000-11-06 15:53:05 +00:00
|
|
|
|
(texinfo-check-for-node-name)
|
|
|
|
|
(texinfo-delete-existing-pointers)
|
|
|
|
|
(message
|
|
|
|
|
"Sequentially updating node: %s ... " (texinfo-copy-node-name))
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(let* ((case-fold-search t)
|
|
|
|
|
(level (texinfo-hierarchic-level)))
|
|
|
|
|
(if (eq level 1)
|
|
|
|
|
(texinfo-top-pointer-case)
|
|
|
|
|
;; else
|
|
|
|
|
(texinfo-sequentially-insert-pointer level 'next)
|
|
|
|
|
(texinfo-sequentially-insert-pointer level 'previous)
|
|
|
|
|
(texinfo-sequentially-insert-pointer level 'up)
|
|
|
|
|
(texinfo-clean-up-node-line)))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2002-03-03 17:30:07 +00:00
|
|
|
|
(defun texinfo-sequentially-insert-pointer (level direction)
|
|
|
|
|
"Insert the `Next', `Previous' or `Up' node name at point.
|
|
|
|
|
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'."
|
|
|
|
|
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(insert
|
|
|
|
|
", "
|
|
|
|
|
(save-excursion
|
|
|
|
|
(texinfo-pointer-name
|
|
|
|
|
(texinfo-sequentially-find-pointer level direction)))))
|
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(defun texinfo-sequentially-find-pointer (level direction)
|
|
|
|
|
"Find next or previous pointer sequentially in Texinfo file, or up pointer.
|
|
|
|
|
Move point to section associated with the pointer. Find point even if
|
|
|
|
|
it is in a different section.
|
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
Return type of pointer (either `normal' or `no-pointer').
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
The first argument is a string specifying the general kind of section
|
1996-06-09 13:40:05 +00:00
|
|
|
|
such as \"chapter\" or \"section\". The section found will be at the
|
1990-10-20 02:38:04 +00:00
|
|
|
|
same hierarchical level in the Texinfo file, or, in the case of the up
|
1997-06-15 17:39:13 +00:00
|
|
|
|
pointer, some level higher. The second argument (one of `next',
|
|
|
|
|
`previous', or `up') specifies whether to find the `Next', `Previous',
|
1990-10-20 02:38:04 +00:00
|
|
|
|
or `Up' pointer."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(let ((case-fold-search t))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(cond ((eq direction 'next)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(forward-line 3) ; skip over current node
|
|
|
|
|
(if (re-search-forward
|
|
|
|
|
texinfo-section-types-regexp
|
|
|
|
|
(point-max)
|
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
((eq direction 'previous)
|
|
|
|
|
(if (re-search-backward
|
|
|
|
|
texinfo-section-types-regexp
|
|
|
|
|
(point-min)
|
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
((eq direction 'up)
|
|
|
|
|
(if (re-search-backward
|
|
|
|
|
(eval (cdr (assoc level texinfo-update-menu-higher-regexps)))
|
2002-03-03 17:30:07 +00:00
|
|
|
|
(point-min)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
t)
|
|
|
|
|
'normal
|
|
|
|
|
'no-pointer))
|
|
|
|
|
(t
|
|
|
|
|
(error "texinfo-sequential-find-pointer: lack proper arguments")))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Inserting `@node' lines
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; The `texinfo-insert-node-lines' function inserts `@node' lines as needed
|
|
|
|
|
;; before the `@chapter', `@section', and such like lines of a region
|
|
|
|
|
;; in a Texinfo file.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(defun texinfo-insert-node-lines (beginning end &optional title-p)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"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
|
1997-06-15 17:39:13 +00:00
|
|
|
|
node names in pre-existing `@node' lines that lack names."
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(interactive "r\nP")
|
|
|
|
|
|
|
|
|
|
;; Use marker; after inserting node lines, leave point at end of
|
|
|
|
|
;; region and mark at beginning.
|
|
|
|
|
|
|
|
|
|
(let (beginning-marker end-marker title last-section-position)
|
|
|
|
|
|
|
|
|
|
;; Save current position on mark ring and set mark to end.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(push-mark end t)
|
|
|
|
|
(setq end-marker (mark-marker))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
|
|
|
|
(goto-char beginning)
|
|
|
|
|
(while (re-search-forward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
texinfo-section-types-regexp
|
|
|
|
|
end-marker
|
|
|
|
|
'end)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Copy title if desired.
|
|
|
|
|
(if title-p
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(beginning-of-line)
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(setq title (buffer-substring
|
|
|
|
|
(point)
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(line-end-position)))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert node line if necessary.
|
|
|
|
|
(if (re-search-backward
|
1999-01-25 17:04:23 +00:00
|
|
|
|
"^@node"
|
|
|
|
|
;; Avoid finding previous node line if node lines are close.
|
|
|
|
|
(or last-section-position
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(line-beginning-position -1))
|
|
|
|
|
t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; @node is present, and point at beginning of that line
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1) ; Leave point just after @node.
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; Else @node missing; insert one.
|
|
|
|
|
(beginning-of-line) ; Beginning of `@section' line.
|
|
|
|
|
(insert "@node\n")
|
|
|
|
|
(backward-char 1)) ; Leave point just after `@node'.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert title if desired.
|
|
|
|
|
(if title-p
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
;; Use regexp based on what info looks for
|
|
|
|
|
;; (alternatively, use "[a-zA-Z]+");
|
|
|
|
|
;; this means we only insert a title if none exists.
|
|
|
|
|
(if (not (looking-at "[^,\t\n ]+"))
|
|
|
|
|
(progn
|
|
|
|
|
(beginning-of-line)
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(insert " " title)
|
|
|
|
|
(message "Inserted title %s ... " title)))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Go forward beyond current section title.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(re-search-forward texinfo-section-types-regexp
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(line-beginning-position 4) t)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(setq last-section-position (point))
|
|
|
|
|
(forward-line 1))
|
|
|
|
|
|
|
|
|
|
;; Leave point at end of region, mark at beginning.
|
|
|
|
|
(set-mark beginning)
|
|
|
|
|
|
|
|
|
|
(if title-p
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(message
|
|
|
|
|
"Done inserting node lines and titles. You may save the buffer.")
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(message "Done inserting node lines. You may save the buffer."))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Update and create menus for multi-file Texinfo sources
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; 1. M-x texinfo-multiple-files-update
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Read the include file list of an outer Texinfo file and
|
|
|
|
|
;; update all highest level nodes in the files listed and insert a
|
|
|
|
|
;; main menu in the outer file after its top node.
|
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; 2. C-u M-x texinfo-multiple-files-update
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Same as 1, but insert a master menu. (Saves reupdating lower
|
|
|
|
|
;; level menus and nodes.) This command simply reads every menu,
|
|
|
|
|
;; so if the menus are wrong, the master menu will be wrong.
|
|
|
|
|
;; Similarly, if the lower level node pointers are wrong, they
|
|
|
|
|
;; will stay wrong.
|
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;; 3. C-u 2 M-x texinfo-multiple-files-update
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Read the include file list of an outer Texinfo file and
|
|
|
|
|
;; update all nodes and menus in the files listed and insert a
|
|
|
|
|
;; master menu in the outer file after its top node.
|
|
|
|
|
|
|
|
|
|
;;; Note: these functions:
|
|
|
|
|
;;;
|
|
|
|
|
;;; * Do not save or delete any buffers. You may fill up your memory.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;; * Do not handle any pre-existing nodes in outer file.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;;; Hence, you may need a file for indices.
|
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; Auxiliary functions for multiple file updating
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-multi-file-included-list (outer-file)
|
|
|
|
|
"Return a list of the included files in OUTER-FILE."
|
|
|
|
|
(let ((included-file-list (list outer-file))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
start)
|
* textmodes/two-column.el (2C-split):
* textmodes/texnfo-upd.el (texinfo-multi-file-included-list):
* textmodes/tex-mode.el (tex-set-buffer-directory):
* textmodes/spell.el (spell-region, spell-string):
* textmodes/reftex.el (reftex-erase-buffer):
(reftex-get-file-buffer-force, reftex-kill-temporary-buffers):
* textmodes/reftex-toc.el (reftex-toc-promote-action):
* textmodes/reftex-sel.el (reftex-get-offset, reftex-insert-docstruct)
(reftex-select-item):
* textmodes/reftex-ref.el (reftex-label-info-update)
(reftex-offer-label-menu):
* textmodes/reftex-index.el (reftex-index-change-entry)
(reftex-index-phrases-info):
* textmodes/reftex-global.el (reftex-create-tags-file)
(reftex-save-all-document-buffers, reftex-ensure-write-access):
* textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite)
(reftex-view-crossref-from-bibtex):
* textmodes/reftex-cite.el (reftex-bibtex-selection-callback)
(reftex-extract-bib-entries-from-thebibliography)
(reftex-all-used-citation-keys, reftex-create-bibtex-file):
* textmodes/refbib.el (r2b-capitalize-title):
(r2b-convert-buffer, r2b-help):
* textmodes/page-ext.el (pages-directory)
(pages-directory-goto-with-mouse):
* textmodes/bibtex.el (bibtex-validate-globally):
* textmodes/bib-mode.el (bib-capitalize-title):
* textmodes/artist.el (artist-clear-buffer, artist-system):
* progmodes/xscheme.el (global-set-scheme-interaction-buffer):
(local-set-scheme-interaction-buffer, xscheme-process-filter)
(verify-xscheme-buffer, xscheme-enter-interaction-mode)
(xscheme-enter-debugger-mode, xscheme-debugger-mode-p)
(xscheme-send-control-g-interrupt, xscheme-start-process)
(xscheme-process-sentinel, xscheme-cd):
* progmodes/verilog-mode.el (verilog-read-always-signals)
(verilog-set-define, verilog-getopt-file)
(verilog-module-inside-filename-p):
* progmodes/sh-script.el:
* progmodes/python.el (python-pdbtrack-get-source-buffer)
(python-pdbtrack-grub-for-buffer, python-execute-file):
* progmodes/octave-inf.el (inferior-octave):
* progmodes/idlwave.el (idlwave-scan-user-lib-files)
(idlwave-shell-compile-helper-routines, idlwave-set-local)
(idlwave-display-completion-list-xemacs, idlwave-list-abbrevs)
(idlwave-display-completion-list-emacs, idlwave-list-load-path-shadows)
(idlwave-completion-fontify-classes, idlwave-display-calling-sequence):
* progmodes/idlw-shell.el (idlwave-shell-examine-display-clear)
(idlwave-shell-filter, idlwave-shell-examine-highlight)
(idlwave-shell-sentinel, idlwave-shell-filter-directory)
(idlwave-shell-display-line, idlwave-shell-set-bp-in-module)
(idlwave-shell-examine-display, idlwave-shell-run-region)
(idlwave-shell-filter-bp, idlwave-shell-save-and-action)
(idlwave-shell-sources-filter, idlwave-shell-goto-next-error):
* progmodes/idlw-help.el (idlwave-help-get-special-help)
(idlwave-help-get-help-buffer):
* progmodes/gud.el (gud-basic-call, gud-find-class)
(gud-tooltip-activate-mouse-motions-if-enabled):
* progmodes/gdb-mi.el (gdb-mouse-toggle-breakpoint-fringe):
* progmodes/ebrowse.el (ebrowse-member-table, ebrowse-save-tree-as)
(ebrowse-view-exit-fn, ebrowse-tags-list-members-in-file)
(ebrowse-tags-next-file):
* progmodes/ebnf2ps.el (ebnf-generate-eps, ebnf-generate-eps)
(ebnf-eps-production-list, ebnf-begin-file, ebnf-log)
(ebnf-eps-finish-and-write):
* progmodes/cpp.el (cpp-edit-save):
* progmodes/cperl-mode.el (cperl-pod-to-manpage):
* progmodes/cc-defs.el (c-emacs-features):
* progmodes/antlr-mode.el (antlr-invalidate-context-cache)
(antlr-directory-dependencies):
* progmodes/ada-xref.el (ada-gnat-parse-gpr, ada-get-ali-file-name)
(ada-run-application, ada-find-in-src-path, ada-goto-parent)
(ada-find-any-references, ada-make-filename-from-adaname)
(ada-make-body-gnatstub):
* obsolete/rnews.el (news-list-news-groups):
* obsolete/resume.el (resume-suspend-hook,resume-write-buffer-to-file):
* obsolete/iso-acc.el (iso-acc-minibuf-setup):
* net/rcirc.el (rcirc-debug):
* net/newst-treeview.el (newsticker--treeview-list-add-item)
(newsticker--treeview-list-clear, newsticker-treeview-browse-url)
(newsticker--treeview-list-update-faces, newsticker-treeview-save)
(newsticker--treeview-item-show-text, newsticker--treeview-item-show)
(newsticker--treeview-tree-update-tag,newsticker--treeview-buffer-init)
(newsticker-treeview-show-item, newsticker--treeview-unfold-node)
(newsticker--treeview-list-clear-highlight)
(newsticker--treeview-list-update-highlight)
(newsticker--treeview-list-highlight-start)
(newsticker--treeview-tree-update-highlight)
(newsticker--treeview-get-selected-item)
(newsticker-treeview-mark-list-items-old)
(newsticker--treeview-set-current-node):
* net/newst-plainview.el (newsticker--buffer-set-uptodate):
* net/newst-backend.el (newsticker--get-news-by-funcall)
(newsticker--get-news-by-wget, newsticker--image-get)
(newsticker--image-sentinel):
* net/mairix.el (mairix-rmail-fetch-field, mairix-gnus-fetch-field):
* net/eudcb-ph.el (eudc-ph-do-request, eudc-ph-open-session):
(eudc-ph-close-session):
* net/eudc.el (eudc-save-options):
* language/thai-word.el (thai-update-word-table):
* language/japan-util.el (japanese-string-conversion):
* international/titdic-cnv.el (tsang-quick-converter)
(ziranma-converter, ctlau-converter):
* international/mule-cmds.el (describe-language-environment):
* international/ja-dic-cnv.el (skkdic-convert-okuri-ari)
(skkdic-convert-postfix, skkdic-convert-prefix):
(skkdic-convert-okuri-nasi, skkdic-convert):
* emacs-lisp/re-builder.el (reb-update-overlays):
* emacs-lisp/pp.el (pp-to-string, pp-display-expression):
* emacs-lisp/gulp.el (gulp-send-requests):
* emacs-lisp/find-gc.el (trace-call-tree):
* emacs-lisp/eieio-opt.el (eieio-browse, eieio-describe-class)
(eieio-describe-generic):
* emacs-lisp/eieio-base.el (eieio-persistent-read):
* emacs-lisp/edebug.el (edebug-outside-excursion):
* emacs-lisp/debug.el (debugger-make-xrefs):
* emacs-lisp/cust-print.el (custom-prin1-to-string):
* emacs-lisp/chart.el (chart-new-buffer):
* emacs-lisp/authors.el (authors-scan-el, authors-scan-change-log):
Use with-current-buffer.
* textmodes/artist.el (artist-system): Don't call
copy-sequence on a fresh string.
* progmodes/idlw-shell.el (easymenu setup): Use dolist.
2009-10-31 02:38:34 +00:00
|
|
|
|
(with-current-buffer (find-file-noselect outer-file)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward "^@include" nil t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(setq start (point))
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(skip-chars-backward " \t")
|
|
|
|
|
(setq included-file-list
|
|
|
|
|
(cons (buffer-substring start (point))
|
|
|
|
|
included-file-list)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(nreverse included-file-list))))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-copy-next-section-title ()
|
|
|
|
|
"Return the name of the immediately following section as a string.
|
|
|
|
|
|
|
|
|
|
Start with point at the beginning of the node line. Leave point at the
|
|
|
|
|
same place. If there is no title, returns an empty string."
|
|
|
|
|
|
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
(let ((node-end (or
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(if (re-search-forward "\\(^@node\\)" nil t)
|
|
|
|
|
(match-beginning 0)))
|
|
|
|
|
(point-max))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(if (re-search-forward texinfo-section-types-regexp node-end t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(progn
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
;; copy title
|
|
|
|
|
(let ((title
|
|
|
|
|
(buffer-substring
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(progn (forward-word-strictly 1) ; skip over section type
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(skip-chars-forward " \t") ; and over spaces
|
|
|
|
|
(point))
|
|
|
|
|
(progn (end-of-line) (point)))))
|
|
|
|
|
title))
|
|
|
|
|
""))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-multi-file-update (files &optional update-everything)
|
|
|
|
|
"Update first node pointers in each file in FILES.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
Return a list of the node names.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
The first file in the list is an outer file; the remaining are
|
|
|
|
|
files included in the outer file with `@include' commands.
|
|
|
|
|
|
|
|
|
|
If optional arg UPDATE-EVERYTHING non-nil, update every menu and
|
|
|
|
|
pointer in each of the included files.
|
|
|
|
|
|
|
|
|
|
Also update the `Top' level node pointers of the outer file.
|
|
|
|
|
|
|
|
|
|
Requirements:
|
|
|
|
|
|
|
|
|
|
* the first file in the FILES list must be the outer file,
|
|
|
|
|
* each of the included files must contain exactly one highest
|
1997-08-04 01:11:01 +00:00
|
|
|
|
hierarchical level node,
|
1990-10-20 02:38:04 +00:00
|
|
|
|
* this node must be the first node in the included file,
|
|
|
|
|
* each highest hierarchical level node must be of the same type.
|
|
|
|
|
|
2004-01-10 15:18:29 +00:00
|
|
|
|
Thus, normally, each included file contains one, and only one, chapter.
|
|
|
|
|
|
|
|
|
|
However, when an included file does not have any node lines in
|
|
|
|
|
it, this command does not try to create a menu entry for it.
|
|
|
|
|
Consequently, you can include any file, such as a version or an
|
|
|
|
|
update file without node lines, not just files that are
|
|
|
|
|
chapters."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; The menu-list has the form:
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
2015-09-17 16:08:20 -07:00
|
|
|
|
;; ((\"node-name1\" . \"title1\")
|
|
|
|
|
;; (\"node-name2\" . \"title2\") ... )
|
1997-08-04 01:11:01 +00:00
|
|
|
|
;;
|
1997-06-15 17:39:13 +00:00
|
|
|
|
;; However, there does not need to be a title field and this function
|
|
|
|
|
;; does not fill it; however a comment tells you how to do so.
|
|
|
|
|
;; You would use the title field if you wanted to insert titles in the
|
|
|
|
|
;; description slot of a menu as a description.
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(let ((case-fold-search t)
|
2003-12-25 20:20:50 +00:00
|
|
|
|
menu-list next-node-name previous-node-name files-with-node-lines)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2003-12-25 20:20:50 +00:00
|
|
|
|
;; Create a new list of included files that only have node lines
|
|
|
|
|
(while files
|
|
|
|
|
(set-buffer (find-file-noselect (car files)))
|
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(when (re-search-forward "^@node" nil t)
|
|
|
|
|
(setq files-with-node-lines (cons (car files) files-with-node-lines)))
|
|
|
|
|
(setq files (cdr files)))
|
|
|
|
|
(setq files-with-node-lines (nreverse files-with-node-lines))
|
|
|
|
|
|
|
|
|
|
;; Find the name of the first node in a subsequent file
|
|
|
|
|
;; and copy it into the variable next-node-name
|
|
|
|
|
(set-buffer (find-file-noselect (car (cdr files-with-node-lines))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
2007-02-03 14:02:45 +00:00
|
|
|
|
;; The following search _must_ succeed, since we verified above
|
|
|
|
|
;; that this file does have a @node line.
|
|
|
|
|
(re-search-forward "^@node" nil t)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-check-for-node-name)
|
|
|
|
|
(setq next-node-name (texinfo-copy-node-name))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(push (cons next-node-name (prog1 "" (forward-line 1)))
|
|
|
|
|
;; Use following to insert section titles automatically.
|
|
|
|
|
;; (texinfo-copy-next-section-title)
|
|
|
|
|
menu-list)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
;; Go to outer file
|
2003-12-25 20:20:50 +00:00
|
|
|
|
;; `pop' is analogous to (prog1 (car PLACE) (setf PLACE (cdr PLACE)))
|
|
|
|
|
(set-buffer (find-file-noselect (pop files-with-node-lines)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(goto-char (point-min))
|
1990-12-20 20:38:22 +00:00
|
|
|
|
(if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
|
2001-08-26 16:49:59 +00:00
|
|
|
|
(error "This buffer needs a Top node"))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-delete-existing-pointers)
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(insert ", " next-node-name ", (dir), (dir)")
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(setq previous-node-name "Top")
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2003-12-25 20:20:50 +00:00
|
|
|
|
(while files-with-node-lines
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2003-12-25 20:20:50 +00:00
|
|
|
|
(if (not (cdr files-with-node-lines))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; No next file
|
|
|
|
|
(setq next-node-name "")
|
|
|
|
|
;; Else,
|
|
|
|
|
;; find the name of the first node in the next file.
|
2003-12-25 20:20:50 +00:00
|
|
|
|
(set-buffer (find-file-noselect (car (cdr files-with-node-lines))))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
2007-02-03 14:02:45 +00:00
|
|
|
|
;; The following search _must_ succeed, since we verified
|
|
|
|
|
;; above that files in files-with-node-lines do have a @node
|
|
|
|
|
;; line.
|
|
|
|
|
(re-search-forward "^@node" nil t)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(texinfo-check-for-node-name)
|
|
|
|
|
(setq next-node-name (texinfo-copy-node-name))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(push (cons next-node-name (prog1 "" (forward-line 1)))
|
|
|
|
|
;; Use following to insert section titles automatically.
|
|
|
|
|
;; (texinfo-copy-next-section-title)
|
|
|
|
|
menu-list))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
;; Go to node to be updated.
|
2003-12-25 20:20:50 +00:00
|
|
|
|
(set-buffer (find-file-noselect (car files-with-node-lines)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(beginning-of-line)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Update other menus and nodes if requested.
|
|
|
|
|
(if update-everything (texinfo-all-menus-update t))
|
|
|
|
|
|
|
|
|
|
(beginning-of-line)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(texinfo-delete-existing-pointers)
|
|
|
|
|
(end-of-line)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert ", " next-node-name ", " previous-node-name ", Top")
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(setq previous-node-name (texinfo-copy-node-name))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
2003-12-25 20:20:50 +00:00
|
|
|
|
(setq files-with-node-lines (cdr files-with-node-lines)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(nreverse menu-list)))
|
|
|
|
|
|
|
|
|
|
(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
|
1997-06-15 17:39:13 +00:00
|
|
|
|
`texinfo-column-for-description'."
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(insert "@menu\n")
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(dolist (entry menu-list)
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Every menu entry starts with a star and a space.
|
|
|
|
|
(insert "* ")
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert the node name (and menu entry name, if present).
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(let ((node-part (car entry)))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(if (stringp node-part)
|
1999-01-25 17:04:23 +00:00
|
|
|
|
;; "Double colon" entry line; menu entry and node name are the same,
|
|
|
|
|
(insert (format "%s::" node-part))
|
|
|
|
|
;; "Single colon" entry line; menu entry and node name are different.
|
|
|
|
|
(insert (format "%s: %s." (car node-part) (cdr node-part)))))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;; Insert the description, if present.
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(when (cdr entry)
|
|
|
|
|
;; Move to right place.
|
|
|
|
|
(indent-to texinfo-column-for-description 2)
|
|
|
|
|
;; Insert description.
|
|
|
|
|
(insert (format "%s" (cdr entry))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert "\n")) ; end this menu entry
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(insert "@end menu"))
|
|
|
|
|
|
|
|
|
|
(defun texinfo-multi-file-master-menu-list (files-list)
|
|
|
|
|
"Return master menu list from files in FILES-LIST.
|
|
|
|
|
Menu entries in each file collected using `texinfo-master-menu-list'.
|
|
|
|
|
|
|
|
|
|
The first file in FILES-LIST must be the outer file; the others must
|
|
|
|
|
be the files included within it. A main menu must already exist."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let (master-menu-list)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(dolist (file files-list)
|
|
|
|
|
(set-buffer (find-file-noselect file))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(message "Working on: %s " (current-buffer))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(setq master-menu-list
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(append master-menu-list (texinfo-master-menu-list))))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
master-menu-list)))
|
|
|
|
|
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
;;; The multiple-file update function
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(defun texinfo-multiple-files-update
|
2007-02-03 14:02:45 +00:00
|
|
|
|
(outer-file &optional make-master-menu update-everything)
|
1990-10-20 02:38:04 +00:00
|
|
|
|
"Update first node pointers in each file included in OUTER-FILE;
|
1993-07-07 22:15:20 +00:00
|
|
|
|
create or update the `Top' level node pointers and the main menu in
|
|
|
|
|
the outer file that refers to such nodes. This does not create or
|
|
|
|
|
update menus or pointers within the included files.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
|
1993-07-07 22:15:20 +00:00
|
|
|
|
insert a master menu in OUTER-FILE in addition to creating or updating
|
|
|
|
|
pointers in the first @node line in each included file and creating or
|
|
|
|
|
updating the `Top' level node pointers of the outer file. This does
|
|
|
|
|
not create or update other menus and pointers within the included
|
|
|
|
|
files.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
With optional UPDATE-EVERYTHING argument (numeric prefix arg, if
|
|
|
|
|
interactive), update all the menus and all the `Next', `Previous', and
|
|
|
|
|
`Up' pointers of all the files included in OUTER-FILE before inserting
|
1993-07-07 22:15:20 +00:00
|
|
|
|
a master menu in OUTER-FILE. Also, update the `Top' level node
|
2011-12-10 12:49:33 +02:00
|
|
|
|
pointers of OUTER-FILE. Do NOT invoke this command with a numeric prefix
|
|
|
|
|
arg, if your files use @node lines without the `Next', `Previous', `Up'
|
|
|
|
|
pointers, because this could produce invalid Texinfo files due to known
|
|
|
|
|
deficiencies in `texinfo-update-node': it does not support the @ignore
|
|
|
|
|
and @if... directives.
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
1997-08-04 01:11:01 +00:00
|
|
|
|
Notes:
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
* this command does NOT save any files--you must save the
|
|
|
|
|
outer file and any modified, included files.
|
|
|
|
|
|
|
|
|
|
* except for the `Top' node, this command does NOT handle any
|
|
|
|
|
pre-existing nodes in the outer file; hence, indices must be
|
|
|
|
|
enclosed in an included file.
|
|
|
|
|
|
|
|
|
|
Requirements:
|
|
|
|
|
|
|
|
|
|
* each of the included files must contain exactly one highest
|
1997-08-04 01:11:01 +00:00
|
|
|
|
hierarchical level node,
|
1990-10-20 02:38:04 +00:00
|
|
|
|
* this highest 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."
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(interactive (cons
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(read-string
|
|
|
|
|
"Name of outer `include' file: "
|
|
|
|
|
(buffer-file-name))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(cond
|
|
|
|
|
((not current-prefix-arg) '(nil nil))
|
|
|
|
|
((listp current-prefix-arg) '(t nil)) ; make-master-menu
|
|
|
|
|
((numberp current-prefix-arg) '(t t))))) ; update-everything
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
|
|
|
|
(let* ((included-file-list (texinfo-multi-file-included-list outer-file))
|
1999-01-25 17:04:23 +00:00
|
|
|
|
(files included-file-list)
|
|
|
|
|
next-node-name
|
|
|
|
|
previous-node-name
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Update the pointers and collect the names of the nodes and titles
|
|
|
|
|
(main-menu-list (texinfo-multi-file-update files update-everything)))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Insert main menu
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Go to outer file
|
|
|
|
|
(set-buffer (find-file-noselect (car included-file-list)))
|
|
|
|
|
(if (texinfo-old-menu-p
|
|
|
|
|
(point-min)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(re-search-forward "^@include")
|
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
2010-11-06 13:23:42 -07:00
|
|
|
|
(line-beginning-position)))
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; If found, leave point after word `menu' on the `@menu' line.
|
|
|
|
|
(progn
|
|
|
|
|
(texinfo-incorporate-descriptions main-menu-list)
|
|
|
|
|
;; Delete existing menu.
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(delete-region
|
|
|
|
|
(point)
|
|
|
|
|
(save-excursion (re-search-forward "^@end menu") (point)))
|
|
|
|
|
;; Insert main menu
|
|
|
|
|
(texinfo-multi-files-insert-main-menu main-menu-list))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Else no current menu; insert it before `@include'
|
|
|
|
|
(texinfo-multi-files-insert-main-menu main-menu-list))
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Insert master menu
|
1990-10-20 02:38:04 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(if make-master-menu
|
|
|
|
|
(progn
|
|
|
|
|
;; First, removing detailed part of any pre-existing master menu
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(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.
|
2010-11-09 20:35:18 -08:00
|
|
|
|
(search-backward "\n@detailmenu" (line-beginning-position -2) t)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Remove detailed master menu listing
|
|
|
|
|
(let ((end-of-detailed-menu-descriptions
|
|
|
|
|
(save-excursion ; beginning of end menu line
|
|
|
|
|
(goto-char (texinfo-menu-end))
|
|
|
|
|
(beginning-of-line) (forward-char -1)
|
|
|
|
|
(point))))
|
|
|
|
|
(delete-region (point) end-of-detailed-menu-descriptions))))
|
|
|
|
|
|
|
|
|
|
;; Create a master menu and insert it
|
|
|
|
|
(texinfo-insert-master-menu-list
|
|
|
|
|
(texinfo-multi-file-master-menu-list
|
|
|
|
|
included-file-list)))))
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
|
|
|
|
;; Remove unwanted extra lines.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(re-search-forward "^@menu")
|
|
|
|
|
(forward-line -1)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert "\n") ; Ensure at least one blank line.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(delete-blank-lines)
|
1997-08-04 01:11:01 +00:00
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(re-search-forward "^@end menu")
|
|
|
|
|
(forward-line 1)
|
2001-10-28 03:24:14 +00:00
|
|
|
|
(insert "\n") ; Ensure at least one blank line.
|
1993-07-07 22:15:20 +00:00
|
|
|
|
(delete-blank-lines))
|
|
|
|
|
|
1990-10-20 02:38:04 +00:00
|
|
|
|
(message "Multiple files updated."))
|
|
|
|
|
|
1993-07-07 22:15:20 +00:00
|
|
|
|
|
2001-10-28 03:24:14 +00:00
|
|
|
|
;; Place `provide' at end of file.
|
1992-03-16 20:39:07 +00:00
|
|
|
|
(provide 'texnfo-upd)
|
|
|
|
|
|
1992-05-30 20:24:49 +00:00
|
|
|
|
;;; texnfo-upd.el ends here
|