2007-07-11 Stephen Compall * smalltalk-mode.el.in: Automatically change to appropriate mode for .st and .star files. --- orig/smalltalk-mode.el.in +++ mod/smalltalk-mode.el.in @@ -1035,6 +1035,22 @@ (skip-chars-forward "^[") (smalltalk-end-of-defun)))) +;; ---[ Emacs configuration ]----------------------------------------- + +;; duplicate zip files' setup for star files or fall back on +;; archive-mode, which scans file contents to determine type so is +;; safe to use +(push (cons "\\.star\\'" + (catch 'archive-mode + (dolist (mode-assoc auto-mode-alist 'archive-mode) + (and (string-match (car mode-assoc) "Starfile.zip") + (functionp (cdr mode-assoc)) + (throw 'archive-mode (cdr mode-assoc)))))) + auto-mode-alist) + +(push "\\.star\\'" inhibit-first-line-modes-regexps) + +(push '("\\.st\\'" . smalltalk-mode) auto-mode-alist) (provide 'smalltalk-mode) (autoload 'gst "@lispdir@/gst-mode.elc" "" t)