[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Insert character pairs
From: |
Juri Linkov |
Subject: |
Re: Insert character pairs |
Date: |
Thu, 29 Apr 2004 14:59:57 +0300 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
Andreas Schwab <address@hidden> writes:
> Juri Linkov <address@hidden> writes:
>
>> To fix it, it seems reasonable to check for character syntax of
>> arguments before inserting a space, i.e. insert a space
>> when character syntax of adjacent characters is the same,
>> (plus ?w and ?_, i.e. inside words as it was before):
>>
>> - (memq (char-syntax (preceding-char)) '(?w ?_ ?\) ))
>> + (memq (char-syntax (preceding-char)) (list ?w ?_ (char-syntax
>> close)))
>
> What's wrong with leaving it as it is?
I wanted to follow the same logic of inserting a space for
other possible character pairs: ", ', `, <>, [], {}.
For example, inserting a quote character next to an existing quote
character could insert a space between them.
Anyway, the docstring of `insert-parentheses' says:
"If `parens-require-spaces' is non-nil, this command also inserts a space
before and after, depending on the surrounding characters."
What does "depending on the surrounding characters" mean, when applied
to other characters, can be interpreted differently.
--
Juri Linkov
http://www.jurta.org/emacs/