GNU bug report logs - #2967
smart quotes in .emacs

Previous Next

Package: emacs;

Reported by: "Kit O'Connell" <vulpine <at> pobox.com>

Date: Sun, 12 Apr 2009 13:00:03 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: 2967 <at> debbugs.gnu.org, rgm <at> gnu.org, monnier <at> iro.umontreal.ca, acm <at> muc.de
Subject: bug#2967: smart quotes in .emacs
Date: Wed, 07 Jun 2017 08:09:30 +0300
> From: npostavs <at> users.sourceforge.net
> Date: Tue, 06 Jun 2017 23:46:48 -0400
> Cc: 2967 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>,
> 	Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> --- i/src/lread.c
> +++ w/src/lread.c
> @@ -3349,6 +3349,15 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
>  	     ? multibyte_chars_in_text ((unsigned char *) read_buffer,
>  					nbytes)
>  	     : nbytes);
> +        if (!quoted && multibyte)
> +          {
> +            switch (STRING_CHAR ((unsigned char *) read_buffer))
> +              {
> +              case 0x2018:      /* LEFT SINGLE QUOTATION MARK */
> +              case 0x2019:      /* RIGHT SINGLE QUOTATION MARK */
> +                invalid_syntax ("strange quote");
> +              }
> +          }
>  	Lisp_Object name = ((uninterned_symbol && ! NILP (Vpurify_flag)
>  			     ? make_pure_string : make_specified_string)
>  			    (read_buffer, nchars, nbytes, multibyte));
> 
> We then get the following error from evaluating (read (format-message "'foo")):
> 
> Debugger entered--Lisp error: (invalid-read-syntax "strange quote")
>   read("’foo")
>   eval((read (format-message "'foo")) nil)

Please include the character itself in the error message text.

Also, are we sure these two are the only ones we want to catch in this
manner?

Finally, if this is accepted, let's have a test for this, and maybe
also some documentation, at least in NEWS.

Thanks.




This bug report was last modified 7 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.