]> git.eshelyaron.com Git - emacs.git/commitdiff
(texinfo-insert-@item): Look for the current
authorEli Zaretskii <eliz@is.elta.co.il>
Sat, 21 Feb 2004 13:51:34 +0000 (13:51 +0000)
committerEli Zaretskii <eliz@is.elta.co.il>
Sat, 21 Feb 2004 13:51:34 +0000 (13:51 +0000)
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.

lisp/ChangeLog
lisp/textmodes/texinfo.el

index b0d2ae201d97860c7cc4cd0e93ef3a911275cf56..4577fd91e8f693650ae6efc006964c086150f188 100644 (file)
@@ -1,3 +1,10 @@
+2004-02-21  Stephen Compall  <s11@member.fsf.org>  (tiny change)
+
+       * textmodes/texinfo.el (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.
+
 2004-02-21  Juri Linkov  <juri@jurta.org>
 
        * ffap.el (ffap-file-at-point): Try parent directories.
index 3c5559897b4b017a240122263e9be315e249f624..8e5b94114a3177b69b3a6f3cdf42bd6751993a33 100644 (file)
@@ -803,10 +803,18 @@ The default is not to surround any existing words with the braces."
   (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.