emacs-devel
[Top][All Lists]
Advanced

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

Re: CC Mode and electric-pair "problem".


From: João Távora
Subject: Re: CC Mode and electric-pair "problem".
Date: Wed, 27 Jun 2018 14:37:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

Hi Alan

>> > unclosed quote will only cause refontification up to the end of the line?
>> > That would be a very nice improvement.  I don't use electric-pair-mode, and
>> > as things currently stand inserting an unmatched quote applies
>> > font-lock-string-face to the entire buffer, which is a bit annoying.
>>     (add-hook 'post-self-insert-hook
>>         (lambda ()
>>    ... 
>>                     (insert last-command-event)))))))
>>         'append 'local)
>
> This is effectively electric-pair-mode, which if enabled, already
> inserts two "s when you type ".
>
> Not everybody likes electric-pair-mode.  I don't think your suggestion
> is any better than mine (snipped) to which you replied.

To be perfectly honest, I got confused by Stefan's suggestion, too.  If
the goal is to have electric-pair-mode-like behaviour, just turn on
electric-pair-mode.

I'd just like to point out, however, that automatically pairing quotes
and parens extends far beyond electric-pair-mode.  Of course I think
it's the best of the bunch, but there are other popular packages like
smartparens, paredit, wrap-region, textmate (and even my previous
autopair which some insist on using for some reason).

João



reply via email to

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