[Top][All Lists]

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

Re: [patch] make electric-pair-mode smarter/more useful

From: Stefan Monnier
Subject: Re: [patch] make electric-pair-mode smarter/more useful
Date: Mon, 16 Dec 2013 13:40:39 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> OK. So Emacs -Q, M-x electric-pair-mode and then in the scratch buffer
>> go to some place in the comment's text and type a double quote. You get
>> it autopaired. If you type it again you get a skip. OK.
>> Now go back to the first quote and type it again. You get a skip. In my
>> opinion, not so nice. Delete the first quote, go back some words and
>> type another quote. You'll get an unbalanced string inside the
>> comment. Again not so nice.
>> Now if you do (setq electric-pair-text-syntax-table
>> prog-mode-syntax-table) and repeat the second paragraph, you'll get
>> results that I personally think are nicer.
>> BTW these are exactly the results that you mostly loose if you do the
>> `electric-pair--looking-at-mismatched-string-p' simplification above.

IIUC the difference between prog-mode-syntax-table and
text-mode-syntax-table is the syntax of ".
I see what you mean, and it's probably true that the problems with
making " have string-syntax in text-mode don't apply here, so we're
better off using a syntax-table where " has string-syntax.


reply via email to

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