changeset 37538:92c065fa43f6

(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.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 02 May 2001 11:44:27 +0000
parents a646c405b550
children 8d13aa9daa13
files lisp/textmodes/texinfmt.el
diffstat 1 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/texinfmt.el	Wed May 02 11:29:57 2001 +0000
+++ b/lisp/textmodes/texinfmt.el	Wed May 02 11:44:27 2001 +0000
@@ -1,7 +1,8 @@
 ;;; texinfmt.el --- format Texinfo files into Info files.
 
 ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 
-;;               1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+;;               1994, 1995, 1996, 1997, 1998, 2000, 2001
+;;    Free Software Foundation, Inc.
 
 ;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org>
 ;; Keywords: maint, tex, docs
@@ -1068,7 +1069,7 @@
       (setq args (cons (if (> end beg) (buffer-substring beg end))
                        args))
       (goto-char next))
-    (if (eolp) (forward-char 1))
+    ;;(if (eolp) (forward-char 1))
     (setq texinfo-command-end (point))
     (nreverse args)))
 
@@ -2366,7 +2367,18 @@
   (insert "\"" (texinfo-parse-arg-discard) "\"")
   (goto-char texinfo-command-start))
 
-(put 'email 'texinfo-format 'texinfo-format-key)
+(put 'email 'texinfo-format 'texinfo-format-email)
+(defun texinfo-format-email ()
+  "Format email address and optional following full name.
+Insert full name, if present, followed by email address
+surrounded by in angle brackets."
+  (let ((args (texinfo-format-parse-args)))
+    (texinfo-discard-command)
+    ;; if full-name
+    (if (nth 1 args)
+        (insert  (nth 1 args) " "))
+    (insert "<" (nth 0 args) ">")))
+
 (put 'key 'texinfo-format 'texinfo-format-key)
 ;; I've decided not want to have angle brackets around these -- rms.
 (defun texinfo-format-key ()
@@ -2391,6 +2403,7 @@
   (concat
    "^@"
    "\\("
+   "display\\|"
    "example\\|"
    "smallexample\\|"
    "lisp\\|"
@@ -2403,6 +2416,7 @@
   (concat
    "^@end "
    "\\("
+   "display\\|"
    "example\\|"
    "smallexample\\|"
    "lisp\\|"
@@ -2826,6 +2840,7 @@
   (require 'sort)
   (save-restriction
     (narrow-to-region start end)
+    (goto-char (point-min))
     (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun)))
 
 ;; Subroutine for sorting an index.
@@ -3823,6 +3838,8 @@
   (let* ((arg (texinfo-parse-arg-discard))
          (flag (car (read-from-string arg)))
          (value (substring arg (cdr (read-from-string arg)))))
+    (if (string-match "^[ \t]+" value)
+	(setq value (substring value (match-end 0))))
     (put flag 'texinfo-whether-setp 'flag-set)
     (put flag 'texinfo-set-value value)))