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: Kevin Rodgers <kevin.d.rodgers@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs pretest -- electric-pair-mode change
Date: Fri, 11 Apr 2014 17:08:32 +0100	[thread overview]
Message-ID: <jjbob0797cv.fsf@gmail.com> (raw)
In-Reply-To: <li8uuo$7ou$1@ger.gmane.org> (Kevin Rodgers's message of "Fri, 11 Apr 2014 08:42:52 -0600")

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
> On 4/3/14 11:33 AM, Stefan Monnier wrote:
>> If we agree that using (point-max) is a bad idea, then the only other
>> option is to try and find some other spot in the buffer (and after
>> point) which is somehow known to be "outside of a string", and in
>> general we don't know how to find such a thing (point-max is the only
>> one we know in general).  Hence electric-pair-string-bound-function
>> (or give up on this idea and do something different).
>
> Would replacing (+ (point) <constant>) with (window-end) give reliable
> behavior, from the user's perspective?  If the extra " is not visible,
> it would not impact the result.

I remember considering this idea, and then abandoning it. I can't
remember the reasoning any more :-), but I think it went along the lines
of "It's possibly nice when (window-end) lands me outside a string, but
what if it lands me inside one? Should I assume the buffer is
quote-unbalanced and not autopair the quote? Should I check if that
window-end-crossing string is terminated? In general it will always be
even if by some other unbalanced quote. So if I do that it's just as
slow and also harder to predict.".

All in all think I prefer the current behaviour, which, by default, only
asserts that (point-max) is outside a string for sure. Here's a related
argument I've made before: If the user has left an unbalanced string far
away down the buffer (i.e. unbalancing starts there), there might be
some disappointment to not seeing the current quote being inserted pair,
but then it's also a warning that something is wrong with the quote
balance somewhere down. The warning comes from not only seeing the quote
not be autopaired but also from the strange fontification that ensues.

João




  parent reply	other threads:[~2014-04-11 16:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADWZ7fJCws0SO1hEn38CpbRMq+Uw397uCFUnA=YJvOaLVEA8UQ@mail.gmail.com>
2014-03-31 13:27 ` Emacs pretest Stefan Monnier
2014-03-31 13:52   ` Bastien
2014-03-31 14:36   ` Tassilo Horn
2014-03-31 15:55   ` João Távora
2014-03-31 16:34     ` Stefan Monnier
2014-04-02 10:11       ` Emacs pretest -- electric-pair-mode change João Távora
2014-04-02 12:58         ` Stefan Monnier
2014-04-02 17:21           ` João Távora
2014-04-02 22:58             ` Stefan Monnier
2014-04-03 11:06               ` João Távora
2014-04-03 14:22                 ` Stefan Monnier
2014-04-03 16:56                   ` João Távora
2014-04-03 17:33                     ` Stefan Monnier
2014-04-03 20:11                       ` João Távora
2014-04-03 20:54                         ` Stefan Monnier
2014-04-04  8:08                           ` João Távora
2014-04-04 12:53                             ` Stefan Monnier
2014-04-04 23:31                               ` João Távora
2014-04-05 15:29                                 ` Stefan Monnier
2014-04-07  7:43                                   ` João Távora
2014-04-07 14:04                                     ` Stefan Monnier
2014-04-04  7:53                         ` Eli Zaretskii
2014-04-04  9:49                           ` João Távora
2014-04-11 14:42                       ` Kevin Rodgers
2014-04-11 15:53                         ` Stefan Monnier
2014-04-11 18:23                           ` João Távora
2014-04-11 19:58                             ` Stefan Monnier
2014-04-12  0:42                               ` João Távora
2014-04-11 16:08                         ` João Távora [this message]
2014-04-03 19:13                   ` Eli Zaretskii
2014-04-03 12:15             ` Dmitry Gutov
2014-04-03 13:43               ` João Távora
2014-04-03 15:24                 ` Stefan Monnier
2014-04-03 14:24               ` Stefan Monnier
2014-04-01 15:15   ` Emacs pretest Dmitry Antipov
2014-04-01 16:36     ` Dmitry Antipov
2014-04-02 12:37       ` Stefan Monnier
2014-04-01 20:50   ` Stephen Berman

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=jjbob0797cv.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=kevin.d.rodgers@gmail.com \
    /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.