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

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

Re: How to complete \] when I input \[ .


From: David Combs
Subject: Re: How to complete \] when I input \[ .
Date: Mon, 15 Sep 2008 02:38:34 +0000 (UTC)

In article <mailman.16901.1218898721.18990.help-gnu-emacs@gnu.org>,
Thierry Volpiatto  <thierry.volpiatto@gmail.com> wrote:
>"xiaopeng hu" <huxiaopengstat@gmail.com> writes:
>
>> I mean \[ \].  thanks
>>
>> 2008/8/16 David Hansen <david.hansen@gmx.net>
>>
>>> On Sat, 16 Aug 2008 21:09:46 +0800 xiaopeng hu wrote:
>>>
>>> > When I input \[ , how to complete \] and put point at middle?
>>> >
>>>
>>> Should work:
>>>
>>> (global-set-key (kbd "[") #'insert-pair)
>>>
>>> David
>
>,----
>| (defun insert-second-hook ()
>|   (interactive)
>|   (insert "\[\\]")
>|   (goto-char (- (point) 2)))
>| (global-set-key (kbd "\[") 'insert-second-hook)
>`----
>
>-- 
>A + Thierry Volpiatto
>Location: Saint-Cyr-Sur-Mer - France

If you're got time, please briefly explain how it works, what it does, etc.

Thanks!

David






reply via email to

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