bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH]texinfo.el: context-sensitive @item insertion


From: Stephen Compall
Subject: [PATCH]texinfo.el: context-sensitive @item insertion
Date: 19 Dec 2003 03:17:56 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

* Bug

lisp/textmodes/texinfo.el: C-c C-c i (address@hidden) inserts
"@item\n", even when point is in a @table.

Normally, this is no problem, but the @table construct asks for the
row header on the same line as address@hidden', so you have to press <DEL>
<SPC>, C-b <SPC>, or even *gasp* C-p C-e <SPC> to go ahead and write
the header.  This, of course, is a great inconvenience.

* Fix

This patch to emacs/lisp/textmodes/texinfo.el 1.94 in CVS, Tue Mar 25
19:32:52 2003, has the aforementioned command look for the current
Texinfo environment, using the same method as C-c C-c e
(address@hidden), and insert a space rather than a newline if
point in a `table' environment.

Tested in GNU Emacs 21.3.

*** /cdrom/emacs-cvs/lisp/textmodes/texinfo.el  Tue Mar 25 13:32:52 2003
--- /home/sirian/ide/emacs/texinfo.el   Wed Dec 17 16:43:15 2003
***************
*** 796,805 ****
    (address@hidden "file" arg))
  
  (defun address@hidden ()
!   "Insert the string address@hidden' in a Texinfo buffer."
!   (interactive)
!   (insert "@item")
!   (newline))
  
  (defun address@hidden (&optional arg)
    "Insert a address@hidden' command in a Texinfo buffer.
--- 796,813 ----
    (address@hidden "file" arg))
  
  (defun address@hidden ()
!   "Insert the string address@hidden' 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"
!         (if (equal (ignore-errors
!                     (save-excursion
!                       (texinfo-last-unended-begin)
!                       (match-string 1)))
!                    "table")
!             ? ;space
!           ?\n)))
  
  (defun address@hidden (&optional arg)
    "Insert a address@hidden' command in a Texinfo buffer.


--
Stephen Compall or s11 or sirian

I put aside my copy of "BOWLING WORLD" and think about GUN CONTROL
legislation...

beanpole UFO bluebird plutonium FSF 2600 Magazine Jiang Zemin $400
million in gold bullion Bletchley Park Honduras Defcon Comirex NORAD
Agfa number key




reply via email to

[Prev in Thread] Current Thread [Next in Thread]