changeset 54109:96cfa4084fd1

(texinfo-insert-@item): Look for the current Texinfo environment, using the same method as in texinfo-insert-@end, and insert a space rather than a newline if point in a `table' environment.
author Eli Zaretskii <eliz@is.elta.co.il>
date Sat, 21 Feb 2004 13:48:44 +0000
parents a187c2573c38
children 820eaef283d1
files lisp/textmodes/texinfo.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/texinfo.el	Sat Feb 21 13:43:32 2004 +0000
+++ b/lisp/textmodes/texinfo.el	Sat Feb 21 13:48:44 2004 +0000
@@ -803,10 +803,18 @@
   (texinfo-insert-@-with-arg "file" arg))
 
 (defun texinfo-insert-@item ()
-  "Insert the string `@item' in a Texinfo buffer."
+  "Insert the string `@item' in a Texinfo buffer.
+If in a table defined by @table, follow said string with a space.
+Otherwise, follow with a newline."
   (interactive)
-  (insert "@item")
-  (newline))
+  (insert "@item"
+	  (if (equal (ignore-errors
+		      (save-excursion
+			(texinfo-last-unended-begin)
+			(match-string 1)))
+		     "table")
+	      ? ;space
+	    ?\n)))
 
 (defun texinfo-insert-@kbd (&optional arg)
   "Insert a `@kbd{...}' command in a Texinfo buffer.