[ESS] confusion with Perl and R-mode in XEmacs

Alex Lancaster alexl at users.sourceforge.net
Mon Oct 18 22:31:27 CEST 2010


----- Original Message -----
> Dear Alex, thanks for the bug report.
> 
> I've just tried changing the alist entry to:
> ("^r$" . r-mode)
> 
> but it doesn't work. The relevant function which checks
> interpreter-mode-alist is set-auto-mode which does the following:
> 
> done (assoc (file-name-nondirectory mode)
> interpreter-mode-alist))
> 
> so the alist keys are just keys, and not regexps.

Hi Stephen,

Actually I changed the alist entry to just:  "r$" not "^r$" and it
does seems to fix it for XEmacs.  I'm not sure if this is the
best or cleanest fix for the issue in XEmacs, but it does appear
to work in my brief testing (I don't use XEmacs regularly, I'm
mostly a GNU Emacs user).

> Also, with a simple file 'test1', and no .pl suffix containing:
> 
> ----------------------------------------------------------------------
> #!/usr/bin/perl
> ----------------------------------------------------------------------
> 
> it does go into Perl mode. This is with emacs 23.2 -- is this an
> XEmacs only bug? Can you check if your proposal (adding regexps to the key)
> solves the problem on XEmacs?

Yes, it is XEmacs-only.  The bug doesn't surface with GNU Emacs.  My 
fix above does seem to fix things with XEmacs, whilst not affecting
GNU Emacs, as well as fixing it for the original reporter, see:

https://admin.fedoraproject.org/updates/emacs-common-ess-5.11-2.fc13

I'm also attaching my patch so you can verify it.

Cheers,
Alex


More information about the ESS-help mailing list