all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Backslash-escaped brackets in string literals
Date: Fri, 24 Jan 2020 12:36:52 -0500	[thread overview]
Message-ID: <jwvblqs4v84.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E4DAA2B8-879A-4791-8DDF-608433A1C749@acm.org> ("Mattias Engdegård"'s message of "Fri, 24 Jan 2020 16:12:51 +0100")

> First of all, is this still true?

Yes and no.  We have started to remove dependence on this, but there's
still some ways to go.  Eli mentioned `C-x 4 a` but there are others.

> I rarely bother escaping brackets in doc strings and it doesn't seem
> to cause any editing confusion. For example, beginning-of-defun
> doesn't seem to be fooled by a '(' in column 1 inside a doc string.
> (I do escape the (fn ...) annotation, probably out of superstition.)

Indeed, it "should" work fine.  You can report any misbehavior as a bug.

> Moreover, these backslashes appear a bit everywhere (not just doc
> strings), not only at bol, and not only before an opening bracket.

Not my fault ;-)

But yes, some authors probably decided it's easier to put them
"everywhere" than to understand exactly when it's needed (and to fix
the cases where refilling moves a `(` to/from BOL).

> A list of all red backslashes attached.

Without seeing the actual occurrences, it's hard to decide what to do
with them.  Those that occur within "normal strings" would benefit from
being fixed (i.e. removing the backslash).  Those that apply to
something else than an open paren probably should be fixed as well.


        Stefan




  parent reply	other threads:[~2020-01-24 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 15:12 Backslash-escaped brackets in string literals Mattias Engdegård
2020-01-24 15:39 ` Eli Zaretskii
2020-01-24 17:36 ` Stefan Monnier [this message]
2020-01-24 22:22   ` Mattias Engdegård
2020-01-25  7:44     ` Eli Zaretskii
2020-01-25 10:34       ` Mattias Engdegård
2020-01-25 13:33         ` Eli Zaretskii
2020-01-25 15:32           ` Mattias Engdegård
2020-01-25 17:15             ` Eli Zaretskii
2020-01-26 11:24               ` Mattias Engdegård
2020-01-26 16:00                 ` Eli Zaretskii
2020-01-25 17:16             ` Drew Adams

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=jwvblqs4v84.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.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.