unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: "João Távora" <joaotavora@gmail.com>,
	"Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: electric-pair-mode as a minor mode?
Date: Fri, 27 Mar 2015 20:38:04 +0100	[thread overview]
Message-ID: <5515B19C.5070303@thregr.org> (raw)
In-Reply-To: <jjb8ueid6xz.fsf@gmail.com>

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.




  parent reply	other threads:[~2015-03-27 19:38 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 19:51 electric-pair-mode as a minor mode? Yuri D'Elia
2015-03-27  2:18 ` Stefan Monnier
2015-03-27  8:04   ` Yuri D'Elia
2015-03-27 13:19     ` Stefan Monnier
2015-03-27 11:18   ` João Távora
2015-03-27 13:25     ` Stefan Monnier
2015-03-27 14:09       ` João Távora
2015-03-27 18:20         ` Stefan Monnier
2015-03-28 16:11           ` João Távora
2015-03-28 20:36             ` Stefan Monnier
2015-03-28 21:47               ` João Távora
2015-03-28 23:09                 ` João Távora
2015-03-29  4:01                 ` Stefan Monnier
2015-03-29 20:41                   ` João Távora
2015-03-30  0:54                     ` Stefan Monnier
2015-03-30 10:46                       ` João Távora
2015-03-30 13:53                         ` Stefan Monnier
2015-03-30 15:43                           ` João Távora
2015-03-30 20:33                             ` Stefan Monnier
2015-03-30 20:42                               ` João Távora
2015-03-30 21:47                                 ` João Távora
2015-03-30 22:02                                 ` Stefan Monnier
2015-04-11 16:06                                   ` João Távora
2015-04-12 11:56                                     ` Stefan Monnier
2015-04-12 13:16                                       ` João Távora
2015-04-12 16:39                                         ` Dmitry Gutov
2015-04-12 22:16                                           ` João Távora
2015-04-12 23:10                                             ` Dmitry Gutov
2015-04-15 21:32                                               ` João Távora
2015-04-15 13:59                                     ` Lars Magne Ingebrigtsen
2015-04-15 21:16                                       ` João Távora
2015-04-15 21:21                                         ` Lars Magne Ingebrigtsen
2015-04-15 21:39                                           ` João Távora
2015-04-15 21:43                                             ` Lars Magne Ingebrigtsen
2015-04-26 10:28                                               ` João Távora
2015-04-26 19:48                                                 ` Lars Magne Ingebrigtsen
2015-04-27  2:29                                                 ` Stefan Monnier
2015-03-27 19:38     ` Yuri D'Elia [this message]
2015-03-27 12:52   ` Tom Willemse
2015-03-27 19:01     ` Stefan Monnier
2015-03-28 15:47       ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5515B19C.5070303@thregr.org \
    --to=wavexx@thregr.org \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).