diff options
| author | Gerd Moellmann | 2001-05-02 11:44:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-05-02 11:44:27 +0000 |
| commit | 8bb6eb14be149c264ea76ff533f72992ffa3e1c4 (patch) | |
| tree | beb7e14ad45dce2bc4570cd90a58f667ea1018d2 | |
| parent | 470bbe9bbee2c6f645bf75ea6c8e88857c7e78d3 (diff) | |
| download | emacs-8bb6eb14be149c264ea76ff533f72992ffa3e1c4.tar.gz emacs-8bb6eb14be149c264ea76ff533f72992ffa3e1c4.zip | |
(texinfo-format-parse-args): Don't
consume a newline following `}'.
(texinfo-format-email): New function.
(toplevel): Use texinfo-format-email for @email.
(texinfo-format-kbd-regexp, texinfo-format-kbd-end-regexp): Add
`display'.
(texinfo-sort-region): Goto point-min before sorting.
(texinfo-set): Remove leading white space from value.
From yagi@is.titech.ac.jp.
| -rw-r--r-- | lisp/textmodes/texinfmt.el | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 461dd9c4399..91caa8a9859 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | ;;; texinfmt.el --- format Texinfo files into Info files. | 1 | ;;; texinfmt.el --- format Texinfo files into Info files. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, | 3 | ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, |
| 4 | ;; 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. | 4 | ;; 1994, 1995, 1996, 1997, 1998, 2000, 2001 |
| 5 | ;; Free Software Foundation, Inc. | ||
| 5 | 6 | ||
| 6 | ;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org> | 7 | ;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org> |
| 7 | ;; Keywords: maint, tex, docs | 8 | ;; Keywords: maint, tex, docs |
| @@ -1068,7 +1069,7 @@ Leave point after argument." | |||
| 1068 | (setq args (cons (if (> end beg) (buffer-substring beg end)) | 1069 | (setq args (cons (if (> end beg) (buffer-substring beg end)) |
| 1069 | args)) | 1070 | args)) |
| 1070 | (goto-char next)) | 1071 | (goto-char next)) |
| 1071 | (if (eolp) (forward-char 1)) | 1072 | ;;(if (eolp) (forward-char 1)) |
| 1072 | (setq texinfo-command-end (point)) | 1073 | (setq texinfo-command-end (point)) |
| 1073 | (nreverse args))) | 1074 | (nreverse args))) |
| 1074 | 1075 | ||
| @@ -2366,7 +2367,18 @@ This command is executed when texinfmt sees @item inside @multitable." | |||
| 2366 | (insert "\"" (texinfo-parse-arg-discard) "\"") | 2367 | (insert "\"" (texinfo-parse-arg-discard) "\"") |
| 2367 | (goto-char texinfo-command-start)) | 2368 | (goto-char texinfo-command-start)) |
| 2368 | 2369 | ||
| 2369 | (put 'email 'texinfo-format 'texinfo-format-key) | 2370 | (put 'email 'texinfo-format 'texinfo-format-email) |
| 2371 | (defun texinfo-format-email () | ||
| 2372 | "Format email address and optional following full name. | ||
| 2373 | Insert full name, if present, followed by email address | ||
| 2374 | surrounded by in angle brackets." | ||
| 2375 | (let ((args (texinfo-format-parse-args))) | ||
| 2376 | (texinfo-discard-command) | ||
| 2377 | ;; if full-name | ||
| 2378 | (if (nth 1 args) | ||
| 2379 | (insert (nth 1 args) " ")) | ||
| 2380 | (insert "<" (nth 0 args) ">"))) | ||
| 2381 | |||
| 2370 | (put 'key 'texinfo-format 'texinfo-format-key) | 2382 | (put 'key 'texinfo-format 'texinfo-format-key) |
| 2371 | ;; I've decided not want to have angle brackets around these -- rms. | 2383 | ;; I've decided not want to have angle brackets around these -- rms. |
| 2372 | (defun texinfo-format-key () | 2384 | (defun texinfo-format-key () |
| @@ -2391,6 +2403,7 @@ If used within a line, follow `@bullet' with braces." | |||
| 2391 | (concat | 2403 | (concat |
| 2392 | "^@" | 2404 | "^@" |
| 2393 | "\\(" | 2405 | "\\(" |
| 2406 | "display\\|" | ||
| 2394 | "example\\|" | 2407 | "example\\|" |
| 2395 | "smallexample\\|" | 2408 | "smallexample\\|" |
| 2396 | "lisp\\|" | 2409 | "lisp\\|" |
| @@ -2403,6 +2416,7 @@ If used within a line, follow `@bullet' with braces." | |||
| 2403 | (concat | 2416 | (concat |
| 2404 | "^@end " | 2417 | "^@end " |
| 2405 | "\\(" | 2418 | "\\(" |
| 2419 | "display\\|" | ||
| 2406 | "example\\|" | 2420 | "example\\|" |
| 2407 | "smallexample\\|" | 2421 | "smallexample\\|" |
| 2408 | "lisp\\|" | 2422 | "lisp\\|" |
| @@ -2826,6 +2840,7 @@ Default is to leave paragraph indentation as is." | |||
| 2826 | (require 'sort) | 2840 | (require 'sort) |
| 2827 | (save-restriction | 2841 | (save-restriction |
| 2828 | (narrow-to-region start end) | 2842 | (narrow-to-region start end) |
| 2843 | (goto-char (point-min)) | ||
| 2829 | (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun))) | 2844 | (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun))) |
| 2830 | 2845 | ||
| 2831 | ;; Subroutine for sorting an index. | 2846 | ;; Subroutine for sorting an index. |
| @@ -3823,6 +3838,8 @@ The command `@value{foo}' expands to the value." | |||
| 3823 | (let* ((arg (texinfo-parse-arg-discard)) | 3838 | (let* ((arg (texinfo-parse-arg-discard)) |
| 3824 | (flag (car (read-from-string arg))) | 3839 | (flag (car (read-from-string arg))) |
| 3825 | (value (substring arg (cdr (read-from-string arg))))) | 3840 | (value (substring arg (cdr (read-from-string arg))))) |
| 3841 | (if (string-match "^[ \t]+" value) | ||
| 3842 | (setq value (substring value (match-end 0)))) | ||
| 3826 | (put flag 'texinfo-whether-setp 'flag-set) | 3843 | (put flag 'texinfo-whether-setp 'flag-set) |
| 3827 | (put flag 'texinfo-set-value value))) | 3844 | (put flag 'texinfo-set-value value))) |
| 3828 | 3845 | ||