From: Eli Zaretskii Date: Sat, 21 Feb 2004 13:51:34 +0000 (+0000) Subject: (texinfo-insert-@item): Look for the current X-Git-Tag: ttn-vms-21-2-B4~7498 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=235de3729648571932a837a5333d1c7388afaba0;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0d2ae201d9..4577fd91e8f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-02-21 Stephen Compall (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 * ffap.el (ffap-file-at-point): Try parent directories. diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 3c5559897b4..8e5b94114a3 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -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.