emacs-devel
[Top][All Lists]
Advanced

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

Re: electric-pair-mode as a minor mode?


From: Yuri D'Elia
Subject: Re: electric-pair-mode as a minor mode?
Date: Fri, 27 Mar 2015 20:38:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0

On 03/27/2015 12:18 PM, João Távora wrote:
>>> I'd like to disable electric-pair-mode in certain buffers.
>>> Probably the most important example is the minibuffer.
>> [ I'm curious to know more about those isearch and minibuffer cases
>>   because I haven't bumped into them.  Not that it makes any difference
>>   to the following.  ]
> 
> I also don't see it. I though that, rightfully so, the syntax in
> isearch-mode is tweaked so that parens don't match there.

I'll have a deeper look why I have this behavior in isearch.

>    (add-hook 'foo-mode-hook
>              (lambda ()
>                (setq-local electric-pair-pairs nil)
>                (setq-local electric-pair-text-pairs nil)
>                (setq-local electric-pair-inhibit-predicate #'identity)))
> 
> So electric-pair-mode is still active (you still get autoskipping if the
> syntax determines it), but autopairing is inhibited. Is this still
> annoying?
>
> But making electric-pair-local-mode also sounds good to me.

For text buffers, I would just disable the minor mode locally.
The way I edit text is way less structured than code and much more chaotic.

Dumb is better for me in this case.

electric-pair not pairing in text mode is less expected than just
turning it off. With the same logic, if electric-pair is on, I would
expect it to pair by default even in text.




reply via email to

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