summaryrefslogtreecommitdiff
path: root/lisp/texinfo.elc
blob: ea4c7061518dba93e0da36eb58ca36df9f02354d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
(defvar texinfo-mode-syntax-table nil)

(if texinfo-mode-syntax-table nil (setq texinfo-mode-syntax-table (make-syntax-table)) (modify-syntax-entry 34 " " texinfo-mode-syntax-table) (modify-syntax-entry 92 " " texinfo-mode-syntax-table) (modify-syntax-entry 64 "\\" texinfo-mode-syntax-table) (modify-syntax-entry 17 "\\" texinfo-mode-syntax-table) (modify-syntax-entry 91 "(]" texinfo-mode-syntax-table) (modify-syntax-entry 93 ")[" texinfo-mode-syntax-table) (modify-syntax-entry 123 "(}" texinfo-mode-syntax-table) (modify-syntax-entry 125 "){" texinfo-mode-syntax-table) (modify-syntax-entry 39 "w" texinfo-mode-syntax-table))

(defvar texinfo-mode-map nil)

(if texinfo-mode-map nil (setq texinfo-mode-map (make-sparse-keymap)) (define-key texinfo-mode-map "" (quote texinfo-format-region)) (define-key texinfo-mode-map "" (quote texinfo-show-structure)) (define-key texinfo-mode-map "}" (quote up-list)) (define-key texinfo-mode-map "{" (quote texinfo-insert-braces)) (define-key texinfo-mode-map "v" (quote texinfo-insert-@var)) (define-key texinfo-mode-map "s" (quote texinfo-insert-@samp)) (define-key texinfo-mode-map "n" (quote texinfo-insert-@node)) (define-key texinfo-mode-map "i" (quote texinfo-insert-@item)) (define-key texinfo-mode-map "e" (quote texinfo-insert-@end)) (define-key texinfo-mode-map "d" (quote texinfo-insert-@dfn)) (define-key texinfo-mode-map "c" (quote texinfo-insert-@code)))

(defun texinfo-insert-@var nil "\
Insert the string @var in a texinfo buffer." (interactive) (byte-code "���c�� �" [nil "@var{}" backward-char] 2))

(defun texinfo-insert-@samp nil "\
Insert the string @samp in a texinfo buffer." (interactive) (byte-code "���c�� �" [nil "@samp{}" backward-char] 2))

(defun texinfo-insert-@node nil "\
Insert the string @node in a texinfo buffer, 
along with a comment indicating the arguments to @node." (interactive) (byte-code "���c���!���!�" [nil "@node     
@comment  node-name,  next,  previous,  up" forward-line -1 forward-char 6] 3))

(defun texinfo-insert-@item nil "\
Insert the string @item in a texinfo buffer." (interactive) (byte-code "���c�� �" [nil "@item" newline] 2))

(defun texinfo-insert-@end nil "\
Insert the string @end in a texinfo buffer." (interactive) (byte-code "���c�" [nil "@end "] 1))

(defun texinfo-insert-@dfn nil "\
Insert the string @dfn in a texinfo buffer." (interactive) (byte-code "���c�� �" [nil "@dfn{}" backward-char] 2))

(defun texinfo-insert-@code nil "\
Insert the string @code in a texinfo buffer." (interactive) (byte-code "���c�� �" [nil "@code{}" backward-char] 2))

(defun texinfo-insert-braces nil "\
Make a pair of braces and be poised to type inside of them.
Use \\[up-list] to move forward out of the braces." (interactive) (byte-code "���c�� �" [nil "{}" backward-char] 2))

(defun texinfo-mode nil "\
Major mode for editing texinfo files.

  It has these extra commands:
\\{texinfo-mode-map}

  These are files that are used as input for TeX to make printed manuals
and also to be turned into Info files by \\[texinfo-format-buffer].
These files must be written in a very restricted and modified version
of TeX input format.

  Editing commands are like text-mode except that the syntax table is
set up so expression commands skip Texinfo bracket groups.  To see
what the Info version of a region of the Texinfo file will look like,
use \\[texinfo-format-region].  This command runs Info on the current region
of the Texinfo file and formats it properly.

  You can show the structure of a Texinfo file with \\[texinfo-show-structure].
This command shows the structure of a Texinfo file by listing the
lines with the @-sign commands for @node, @chapter, @section and the
like.  These lines are displayed in another window called the *Occur*
window.  In that window, you can position the cursor over one of the
lines and use \\[occur-mode-goto-occurrence], to jump to the
corresponding spot in the Texinfo file.

  In addition, Texinfo mode provides commands that insert various
frequently used @-sign commands into the buffer.  You can use these
commands to save keystrokes.  And you can insert balanced braces with
\\[texinfo-insert-braces] and later use the command \\[up-list] to
move forward past the closing brace.

Entering Texinfo mode calls the value of text-mode-hook, and then the
value of texinfo-mode-hook." (interactive) (byte-code "͈� �ω�Љ��
!��!�
����!�lj���!��P����!��	P�	���!�Չ
���!�։���!�׉����\"�" [mode-name major-mode texinfo-mode-map texinfo-mode-syntax-table local-abbrev-table text-mode-abbrev-table require-final-newline t paragraph-separate paragraph-start fill-column comment-start comment-start-skip nil kill-all-local-variables "Texinfo" texinfo-mode use-local-map set-syntax-table make-local-variable "^\\|^@[a-zA-Z]*[ 
]\\|" 72 "@c " "@c +" run-hooks text-mode-hook texinfo-mode-hook] 12))

(defvar texinfo-heading-pattern "^@\\(chapter\\|unnum\\|appendix\\|sect\\|sub\\|heading\\|major\\|node\\)" "\
This is a regular expression to match Texinfo lines that are chapter
or sections headings or like such.")

(defun texinfo-show-structure nil "\
Show the structure of a Texinfo file by listing the lines with the
@-sign commands for @node, @chapter, @section and the like.  Lines
with structuring commands in them are displayed in another window
called the *Occur* window.  In that window, you can position the
cursor over one of the lines and use \\[occur-mode-goto-occurrence],
to jump to the corresponding spot in the Texinfo file." (interactive) (byte-code "���eb��!)���!�eb���!�" [texinfo-heading-pattern nil occur pop-to-buffer "*Occur*" flush-lines "-----"] 4))