[ESS] problem with file extension recognition

Martin Maechler maechler at stat.math.ethz.ch
Fri Feb 11 19:54:25 CET 2005

>>>>> "Jack" == Jack  <ostroffjh at sbcglobal.net>
>>>>>     on Fri, 11 Feb 2005 07:50:31 -0500 writes:

    Jack> On 2005.02.11 03:13, Martin Maechler wrote:
    >> >>>>> Jack <ostroffjh at sbcglobal.net> on Wed, 9 Feb 2005 20:14:44
    Jack> I'm using GNU emacs 20.4.1 and ESSS 5.2.5 and ESS
    Jack> automatically recognizes any .lst file as a SAS
    Jack> listing, and makes the buffer read only.
    Jack> Unfortunately, most of the .lst files I edit are
    Jack> Oracls sql-plus spool files.  Is there an easy way to
    Jack> get ESS to not mark a .lst file read only unless it
    Jack> specifically opens it as the listing from a .sas file?
    Jack> (I've tried some other versions of emacs and also
    Jack> xemacs, and the behavior is identical.)  I know I can
    Jack> toggle the 'read-only' attribute, but I'd rather not
    Jack> need to.
    >> Do you need SAS mode at all?
    >> If not, edit your copy of
    >> ess-site.el  (and make sure there's no older version of
    >> ess-site.elc )
    >> by replacing lines 430-431
    >> (ess-message "[ess-site:] require 'essd-sas ...")
    >> (require 'essd-sas)
    >> by
    >> ;;N This changes ".lst" extension auto-mode:
    >> ;;N (ess-message "[ess-site:] require 'essd-sas ...")
    >> ;;N (require 'essd-sas)
    >> If you use ESS for SAS, the solution is to modify
    >> essl-sas.el  (in a different way) but let's hope you don't need
    >> SAS anyway...
    Jack> Martin - Thanks for the reply.  Unfortunately, I do use SAS mode
    Jack> (actually more often than I use R).  

  how horrible and pitiful :-( ;-)

    Jack> However, if the change to essl-sas.el is too
    Jack> complicated, 

No, it's not complicated, at all:

You disable the *.lst auto-mode (see below) and your will have
to activate sas-listing-mode by 
	    M-x SAS-listing-mode 
yourself in those cases where you still want it.

Just replace the 3 lines (line nr. 112--114) in essl-sas.el

(if (not (featurep 'xemacs))
    (setq auto-mode-alist
	(append '(("\\.[lL][sS][tT]\\'" . sas-listing-mode)) auto-mode-alist)))

by the four lines

;;NO: I hate being put in read-only sas-listing-mode for all *.lst files:
;;NO (if (not (featurep 'xemacs))
;;NO     (setq auto-mode-alist
;;NO 	(append '(("\\.[lL][sS][tT]\\'" . sas-listing-mode)) auto-mode-alist)))


``Of course'', the next version of ESS will have a customizable
variable that allows to turn off the automatic sas-listing-mode
more elegantly.


More information about the ESS-help mailing list