Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Emacs version and LISP interpretation

263 views
Skip to first unread message

richard.christensen

unread,
May 11, 2010, 11:44:57 PM5/11/10
to
Hi,

I was transferring a new mode and .emacs file from my PC to my work
linux box. My PC is running 23.1.1 and my linux box is running
21.3.1. Anyway I was getting the following error from the Linux
version "Invalid escape character syntax". I was able to trace it
down to instances like (insert ?\s). My PC will insert a space and on
the linux box will give an error. I did try (insert " ") and this
works just fine as well as (insert ?\t). Why isn't \s recognized? Is
this common problem from older versions? What would be the best work-
around? Have the current version of emacs installed?

Thanks.

Richard.

Tim X

unread,
May 12, 2010, 1:44:38 AM5/12/10
to
"richard.christensen" <richard.c...@avagotech.com> writes:

Did you also transfer the *.elc files? If so, this wold be the problem.
Changes in *.elc format in emacs 22 (and possibly emacs 23) would cause
problems as *.elc files are normally forward compatible but not
backwards compatible. To fix this, recompile the files with emacs 21.

If you didn't transfer the *.elc files, then it could simply be elisp
incompatiblity. If you look at the NEWS files for emacs 22 and emacs 23,
it includes a section on incompatible changes in elsip functions. The
process would be to replace the incompatiblefunctions with the emacs 21
versions.

Having said all of that, emacs 21 is now quite old. We are now up to
emacs 23.2 as the most recent release. Emacs 21 is about 10 years old!
Many newer versions of elisp packages will have issues with emacs 21.
The handlinging of character sets in emacs 21 is also quite poor
compared to emacs 23.

Using --debug-init on your transferred .emacs file may help identify
problem areas.

Tim


--
tcross (at) rapttech dot com dot au

Stefan Monnier

unread,
May 12, 2010, 10:58:09 AM5/12/10
to
> version "Invalid escape character syntax". I was able to trace it
> down to instances like (insert ?\s). My PC will insert a space and on

?\s is a "new" syntax for the space character, introduced in Emacs-22.


Stefan

richard.christensen

unread,
May 12, 2010, 1:40:47 PM5/12/10
to
Hi Tim,

I did not transfer the *.elc files since I was hacking a current file
to come up with a new mode. I was going to do the compiling after all
the bugs were done. I know it is an old version. But getting the
technical computing team to download a new version can be like pulling
teeth. It does sound like it is time for the dentist though.

Thanks.

On May 11, 11:44 pm, Tim X <t...@nospam.dev.null> wrote:

Drew Adams

unread,
Dec 8, 2010, 1:47:04 PM12/8/10
to Stefan Monnier, help-gn...@gnu.org

So the answer is that you need to change (insert ?\s) to (insert ?\s ). That
is, leave at least one space after the \s.

IMHO, the Emacs source code should itself leave such a space anyway, so that it
wouldn't gratuitously break backward compatibility this way. What's the big
cost - one space char?

But backward compatibility is such a low (read non) priority for Emacs Dev that
it seems code was intentionally changed from "... ?\s )" to just "... ?\s)".
Inconsiderate, IMHO.

I've seen more than one library broken this way (broken for older Emacs
versions). By that I mean that *ONLY* this change was made - there was no other
recent feature used that would otherwise invalidate use with an older version.
(No, I don't remember which libraries now.)


Stefan Monnier

unread,
Dec 9, 2010, 10:54:26 PM12/9/10
to
> So the answer is that you need to change (insert ?\s) to (insert ?\s ).
> That is, leave at least one space after the \s.

No, ?\s is new, so ?\s won't work even if you add a space after it.
The old syntax is ?\ (where the space after the backslash is important).

> I've seen more than one library broken this way (broken for older Emacs
> versions).

We (Emacs maintainers) only changed the code of the files distributed
along with Emacs, so we don't get to introduce such bugs directly.
Of course, some of those changes are then fed back upstream and the
upstream maintainer may either fail to notice the incompatibility
introduced, or consider it to be minor.


Stefan

Drew Adams

unread,
Dec 10, 2010, 12:43:27 AM12/10/10
to Stefan Monnier, help-gn...@gnu.org
> > So the answer is that you need to change (insert ?\s) to
> > (insert ?\s ). That is, leave at least one space after the \s.
>
> No, ?\s is new, so ?\s won't work even if you add a space after it.
> The old syntax is ?\ (where the space after the backslash is
> important).

Right, my bad; good catch. What you say is what I meant to say:
change (insert ?\s) to (insert ?\ ), where, as you point out, the space is
important.

(I was no doubt confusing the SPC char syntax with the regexp syntax for
matching a whitespace char, which is `\s ' or `\s-'.)


0 new messages