aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRobert J. Chassell2002-12-10 19:01:36 +0000
committerRobert J. Chassell2002-12-10 19:01:36 +0000
commitd79abb69849ed760232027c7db07c2501b83fbfb (patch)
treef5975b7439907d4a0d10f72b0a249af846efed3b /lisp/textmodes
parent88069dff55bb8a074b8130485382ec2c283725f5 (diff)
downloademacs-d79abb69849ed760232027c7db07c2501b83fbfb.tar.gz
emacs-d79abb69849ed760232027c7db07c2501b83fbfb.zip
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
(@verb, @image): new commands (@kbdinputstyle, @vskip, @evenfooting, @evenheading, @oddfooting, @oddheading, @everyfooting, @everyheading, @documentdescription): Add these commands, none of which should appear in an Info environment; but if they do, these definitions should cause them to be discarded.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/texinfmt.el83
1 files changed, 83 insertions, 0 deletions
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index 6f1da5db525..82c35f35c8f 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -1391,6 +1391,39 @@ otherwise, insert URL-TITLE followed by URL in parentheses."
1391 (texinfo-discard-command)) 1391 (texinfo-discard-command))
1392 1392
1393 1393
1394;;; @kbdinputstyle, @vskip, headings & footings
1395;; These commands for not for Info and should never
1396;; appear in an Info environment; but if they do,
1397;; this causes them to be discarded.
1398
1399;; @kbdinputstyle
1400(put 'kbdinputstyle 'texinfo-format 'texinfo-discard-line-with-args)
1401
1402;; @vskip
1403(put 'vskip 'texinfo-format 'texinfo-discard-line-with-args)
1404
1405;; headings & footings
1406(put 'evenfooting 'texinfo-format 'texinfo-discard-line-with-args)
1407(put 'evenheading 'texinfo-format 'texinfo-discard-line-with-args)
1408(put 'oddfooting 'texinfo-format 'texinfo-discard-line-with-args)
1409(put 'oddheading 'texinfo-format 'texinfo-discard-line-with-args)
1410(put 'everyfooting 'texinfo-format 'texinfo-discard-line-with-args)
1411(put 'everyheading 'texinfo-format 'texinfo-discard-line-with-args)
1412
1413
1414;;; @documentdescription ... @end documentdescription
1415;; This command is for HTML output and should never
1416;; appear in an Info environment; but if it does,
1417;; this causes it to be discarded.
1418
1419(put 'documentdescription 'texinfo-format 'texinfo-format-documentdescription)
1420(defun texinfo-format-documentdescription ()
1421 (delete-region texinfo-command-start
1422 (progn (re-search-forward "^@end documentdescription[ \t]*\n")
1423 (point))))
1424
1425
1426
1394;;; @center, @sp, and @br 1427;;; @center, @sp, and @br
1395 1428
1396(put 'center 'texinfo-format 'texinfo-format-center) 1429(put 'center 'texinfo-format 'texinfo-format-center)
@@ -2167,6 +2200,27 @@ This command is executed when texinfmt sees @item inside @multitable."
2167 (setq fill-column existing-fill-column))) 2200 (setq fill-column existing-fill-column)))
2168 2201
2169 2202
2203;;; @image
2204;; Use only the FILENAME argument to the command.
2205;; In Info, ignore the other arguments.
2206
2207(put 'image 'texinfo-format 'texinfo-format-image)
2208(defun texinfo-format-image ()
2209 "Insert an image from an an file ending in .txt.
2210Use only the FILENAME arg; for Info, ignore the other arguments to @image."
2211 (let ((args (texinfo-format-parse-args))
2212 filename)
2213 (when (null (nth 0 args))
2214 (error "Invalid image command"))
2215 (texinfo-discard-command)
2216 ;; makeinfo uses FILENAME.txt
2217 (setq filename (format "%s.txt" (nth 0 args)))
2218 (message "Reading included file: %s" filename)
2219 ;; verbatim for Info output
2220 (goto-char (+ (point) (cadr (insert-file-contents filename))))
2221 (message "Reading included file: %s...done" filename)))
2222
2223
2170;;; @ifinfo, @iftex, @tex, @ifhtml, @html, @ifplaintext, @ifxml, @xml 2224;;; @ifinfo, @iftex, @tex, @ifhtml, @html, @ifplaintext, @ifxml, @xml
2171;; @ifnottex, @ifnotinfo, @ifnothtml, @ifnotplaintext, @ifnotxml 2225;; @ifnottex, @ifnotinfo, @ifnothtml, @ifnotplaintext, @ifnotxml
2172 2226
@@ -2459,6 +2513,35 @@ surrounded by in angle brackets."
2459 (insert (texinfo-parse-arg-discard)) 2513 (insert (texinfo-parse-arg-discard))
2460 (goto-char texinfo-command-start)) 2514 (goto-char texinfo-command-start))
2461 2515
2516;; @verb{<char>TEXT<char>} (in `makeinfo' 4.1 and later)
2517(put 'verb 'texinfo-format 'texinfo-format-verb)
2518(defun texinfo-format-verb ()
2519 "Format text between non-quoted unique delimiter characters verbatim.
2520Enclose the verbatim text, including the delimiters, in braces. Print
2521text exactly as written (but not the delimiters) in a fixed-width.
2522
2523For example, @verb\{|@|\} results in @ and
2524@verb\{+@'e?`!`+} results in @'e?`!`."
2525
2526 (let ((delimiter (buffer-substring-no-properties
2527 (1+ texinfo-command-end) (+ 2 texinfo-command-end))))
2528 (unless (looking-at "{")
2529 (error "Not found: @verb start brace"))
2530 (delete-region texinfo-command-start (+ 2 texinfo-command-end))
2531 (search-forward delimiter))
2532 (delete-backward-char 1)
2533 (unless (looking-at "}")
2534 (error "Not found: @verb end brace"))
2535 (delete-char 1))
2536
2537;; as of 2002 Dec 10
2538;; see (texinfo)Block Enclosing Commands
2539;; need: @verbatim
2540
2541;; as of 2002 Dec 10
2542;; see (texinfo)verbatiminclude
2543;; need: @verbatiminclude FILENAME
2544
2462(put 'bullet 'texinfo-format 'texinfo-format-bullet) 2545(put 'bullet 'texinfo-format 'texinfo-format-bullet)
2463(defun texinfo-format-bullet () 2546(defun texinfo-format-bullet ()
2464 "Insert an asterisk. 2547 "Insert an asterisk.