all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lawrence Mitchell <wence@gmx.li>
To: bug-gnu-emacs@gnu.org
Cc: emacs-pretest-bug@gnu.org
Subject: bug#1187: 23.0.60; Cannot read vline.el - invalid read syntax
Date: Fri, 17 Oct 2008 13:30:24 +0100	[thread overview]
Message-ID: <?fnord?y3h6r66f5rq7.fsf@ID-97657.user.individual.net> (raw)
In-Reply-To: 00f801c92fd5$54f26100$c2b22382@us.oracle.com

Drew Adams wrote:
> Library vline.el can be read fine in Emacs 22, but Emacs 23 raises an
> error, saying Invalid read syntax: "?".

The following sequence of events works for me in

GNU Emacs 23.0.60.4 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll
bars) of 2008-10-07 on lamacq.ph.ed.ac.uk

$ wget http://www.emacswiki.org/cgi-bin/emacs/download/vline.el \
-O /tmp/vline.el

$ LANG=C emacs -Q --eval '(load-file "/tmp/vline.el")'
LANG=C so that current-language-environment is "ASCII"
and default-buffer-file-coding-system is nil.

Successfully prints:
Loading /tmp/vline.el (source)...done

> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
>  of 2008-10-03 on LENNART-69DE564
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
> -fno-crossjumping'

> Important settings:
>   value of $LC_ALL: nil
>   value of $LC_COLLATE: nil
>   value of $LC_CTYPE: nil
>   value of $LC_MESSAGES: nil
>   value of $LC_MONETARY: nil
>   value of $LC_NUMERIC: nil
>   value of $LC_TIME: nil
>   value of $LANG: ENU
                    ^^^ this seems to be the culprit.

LANG=ENU is an unknown locale here but if LANG=en_GB such that
default-buffer-file-coding-system is iso-latin-1-unix then the
section of the file that causes problems is:
(memq char '(?\t ? ))

where the second character is:

|         character:   (12288, #o30000, #x3000)
| preferred charset: unicode (Unicode (ISO10646))
|        code point: 0x3000
|            syntax: _ 	which means: symbol
|          category: c:Chinese h:Korean j:Japanese
| 		   |:While filling, we can break a line at this character.
|       buffer code: #xE3 #x80 #x80
|         file code: #xE3 #x80 #x80 (encoded by coding system utf-8-unix)
|           display: by this font (glyph code)
|     xft:-unknown-Kochi Gothic-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x6F3)

| Character code properties: customize what to show
|   name: IDEOGRAPHIC SPACE
|   general-category: Zs (Separator, Space)
|   decomposition: (<wide> 32) (<wide> ' ')


The difference between emacs-21.3 and emacs 23 appears to be that
the former ignores the two extra bytes when reading in latin-1
but emacs 23 does not:

$ od -c /tmp/f
0000000   ? 343 200 200
0000004

Emacs 23:

(let ((coding-system-for-read 'iso-latin-1)
      ret)
  (with-temp-buffer
    (insert-file-contents "/tmp/f")
    (setq ret (read (current-buffer))))
  (insert ret))

=>

(invalid-read-syntax "?")
  read(#<buffer  *temp*>)

----
(let ((coding-system-for-read 'utf-8)
      ret)
  (with-temp-buffer
    (insert-file-contents "/tmp/f")
    (setq ret (read (current-buffer))))
  (insert ret))

=>

IDEOGRAPHIC SPACE is inserted correctly


Emacs 21.3

(let ((coding-system-for-read 'iso-latin-1)
      ret)
  (with-temp-buffer
    (insert-file-contents "/tmp/f")
    (setq ret (read (current-buffer))))
  (insert ret))

=>

ã ; LATIN SMALL LETTER A WITH TILDE is inserted.

-----
(let ((coding-system-for-read 'utf-8)
      ret)
  (with-temp-buffer
    (insert-file-contents "/tmp/f")
    (setq ret (read (current-buffer))))
  (insert ret))

=>

IDEOGRAPHIC SPACE is inserted correctly
-- 
Lawrence Mitchell <wence@gmx.li>








  parent reply	other threads:[~2008-10-17 12:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwv3aivjkhw.fsf-monnier+emacsbugreports@gnu.org>
2008-10-16 21:22 ` bug#1187: 23.0.60; Cannot read vline.el - invalid read syntax Drew Adams
2008-10-16 23:41   ` Lennart Borgman (gmail)
2008-10-17  0:00     ` Drew Adams
2008-10-17  8:18       ` Eli Zaretskii
2008-10-17  8:36         ` Lennart Borgman (gmail)
2008-10-17  9:57           ` Eli Zaretskii
2008-10-17  8:15   ` Eli Zaretskii
2008-10-17 14:26     ` Drew Adams
2008-10-17 12:30   ` Lawrence Mitchell [this message]
2008-10-17 13:07     ` Eli Zaretskii
2008-10-17 14:40       ` Drew Adams
2008-10-17 15:53         ` Drew Adams
2008-10-17 16:04           ` Eli Zaretskii
2008-10-17 14:58       ` Lennart Borgman (gmail)
2008-10-17 15:18         ` Drew Adams
2008-10-17 15:58           ` Lawrence Mitchell
2008-10-17 16:09             ` Drew Adams
2008-10-17 16:00           ` Eli Zaretskii
2008-10-17 16:21             ` Drew Adams
2008-10-17 18:24               ` Eli Zaretskii
2008-10-20 10:28                 ` Kenichi Handa
2008-10-20 10:58                   ` Eli Zaretskii
2008-10-21  2:40                     ` Kenichi Handa
2008-10-21  4:46                       ` Drew Adams
2008-10-17 15:55   ` bug#1187: marked as done (23.0.60; Cannot read vline.el - invalid read syntax) Emacs bug Tracking System
     [not found]   ` <handler.1187.D1187.122425837312105.notifdone@emacsbugs.donarmstrong.com>
2008-10-17 16:48     ` bug#1187: closed by Stefan Monnier <monnier@iro.umontreal.ca> (Re: bug#1187: 23.0.60; " 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='?fnord?y3h6r66f5rq7.fsf@ID-97657.user.individual.net' \
    --to=wence@gmx.li \
    --cc=1187@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=emacs-pretest-bug@gnu.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.