all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 20852@debbugs.gnu.org
Subject: bug#20852: 24.3; update-file-autoloads doesn't accept unescaped parenthesis character literal
Date: Thu, 02 Jul 2015 11:50:53 -0400	[thread overview]
Message-ID: <jwvk2uivag9.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAArVCkQxtDeVA=p4vYsOzrBahZ5vB0YcvN1SJur6Fv62nL0VGQ@mail.gmail.com> (Philipp Stephani's message of "Tue, 30 Jun 2015 20:43:01 +0000")

> I've attached a patch that uses the same mechanism as the check for
> old-style backquotes.

Looks pretty good, thank you.
A few comments and nitpicks:

> +static void
> +load_warn_unescaped_character_literals (Lisp_Object file) {
> +  if (!NILP (Vunescaped_character_literals))
> +    {
> +      AUTO_STRING (format, "Loading `%s': unescaped parenthesis character literals detected!");
> +      CALLN (Fmessage, format, file);
> +    }
> +}

It would be even better to show the actual unescaped character literal(s).
Either just displaying one of the chars, or displaying them all.

>  	if (c == ' ' || c == '\t')
>  	  return make_number (c);
> 
> +	if (c == '(' || c == ')')
> +	  Vunescaped_character_literals = Qt;

I think we want to emit the same warning for several other chars, at
least ';', '"', '[', and ']' (we could also include ' ' and '\t', tho
I'm not sure it's worth the trouble.  If/when we want to do that, we'd
want to do it not just for ?<SPC> and ?<TAB> but also for ?\<SPC>
and ?\<TAB> and recommend the use of ?\s and ?\t instead).

>    DEFSYM (Qold_style_backquotes, "old-style-backquotes");
> +  DEFSYM (Qunescaped_character_literals, "unescaped-character-literals");

I think "old-style-backquotes" was a bad choice.  It should have been
"read--found-old-style-backquotes" or something along these lines.
AFAIK this variable is only used internally, so we can rename it without
any extra precautions.  If you could do that in your patch, that'd
be great.

One more thing: old-style-backquotes is not only used by `load' but also
by the byte-compiler.  So take a look at bytecomp.el where you'll
probably want to add similar code for your unescaped-character-literals.


        Stefan





  reply	other threads:[~2015-07-02 15:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 19:22 bug#20852: 24.3; update-file-autoloads doesn't accept unescaped parenthesis character literal Philipp Stephani
2015-06-19 21:24 ` Stefan Monnier
2015-06-21 12:13   ` Philipp Stephani
2015-06-22  1:18     ` Stefan Monnier
2015-06-28 13:12       ` Philipp Stephani
2015-06-30 20:43         ` Philipp Stephani
2015-07-02 15:50           ` Stefan Monnier [this message]
     [not found]             ` <20170501142718.3510-1-phst@google.com>
2017-05-01 17:59               ` bug#20852: [PATCH] Warn about missing backslashes during load Stefan Monnier
2017-05-01 18:41                 ` Philipp Stephani
2017-05-06 21:14             ` [PATCH] Make `old-style-backquotes' variable internal Philipp
2017-05-07  2:31               ` Eli Zaretskii
2017-05-07 11:49                 ` Philipp
2017-05-13 10:35                   ` Philipp Stephani

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=jwvk2uivag9.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20852@debbugs.gnu.org \
    --cc=p.stephani2@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.