all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: joaotavora@gmail.com (João Távora)
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Yuri D'Elia <wavexx@thregr.org>, emacs-devel@gnu.org
Subject: Re: electric-pair-mode as a minor mode?
Date: Sat, 28 Mar 2015 21:47:20 +0000	[thread overview]
Message-ID: <m2y4mgssk7.fsf@gmail.com> (raw)
In-Reply-To: <jwviodk3lry.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 28 Mar 2015 16:36:59 -0400")

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> I like my syntax-table to understand to know as much as possible, so
>> that other commands can dwim. Perhaps I'll try a message-mode hack to
>> make blockquotes and smileys comment syntax. That should bring the 90%
>> to 99%...
> Those `)' thingies shouldn't be counted.  There can be many other
> reasons.  Here's another: in message-mode you might have a buffer that
>
>    > foo far bla (blibli
>    Here's my answer to that.

But this is precisely the use case for the "message mode hack" earlier:
If the following line (I called it a "blockquote" but perhaps it has
another name)

   > foo bar bla (blibli

is seen, in message-mode, has having comment syntax, then you shouldn't
have that problem. If, additionally, smileys and other sporadic
artifacts can also be identified as comments or strings, the situations
you mention should be further reduced.

I haven't tested, because I don't have time to learn about implementing
comment syntaxes right now (I also probably won't if you tell me it's
futile or problematic for some other reason). But anyway in my naive
assessment it should work as well as it already does for programming
modes, where `(' and `)' thingies can exist unpaired in comments and
string literals.

> Again, the parens are not balanced (in this case because the matching
> paren was simply in a part of the message which was omitted).
>
>> Anyway `electric-pair-local-mode' is now available so people can choose.
>
> I actually don't want to disable electric-pair-mode in text-modes.
> But I do find it occasionally too optimistic in its assessment of what
> it knows.

Yes, I understand, but what do you suggest? I just hope it's not
changing the default value of `electric-pair-preserve-balance', which I
personally like very much... Why don't you

   (add-hook 'text-mode-hook
     (lambda () (setq-local electric-pair-preserve-balance nil)))

in your configuration?

João





  reply	other threads:[~2015-03-28 21:47 UTC|newest]

Thread overview: 45+ 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 [this message]
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
2015-03-27 12:52   ` Tom Willemse
2015-03-27 19:01     ` Stefan Monnier
2015-03-28 15:47       ` bug#19528: " João Távora
2015-03-28 15:47       ` João Távora
2015-03-28 17:37         ` bug#19528: " Glenn Morris
2015-03-28 21:01           ` João Távora
2015-04-14  6:28             ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=m2y4mgssk7.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=wavexx@thregr.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.