Menu

#7 Don't override default auto-mode-alist

open
nobody
None
5
2009-11-25
2009-11-25
No

Hello,

Please see Debian bug htt:p://bugs.debian.org/557932

The entry:

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.m$" . matlab-mode))

overrides the default Emacs setting of objc-mode.

I suggest using a defcustom (defaulting to nil) to set this up if desired.

Thanks,
Peter

Discussion

  • Peter S Galbraith

    Something like:

    (defcustom matlab-auto-mode nil
    "*Enter matlab-mode when editing .m files.
    Technically, this adjusts the `auto-mode-list' when set.
    To unset, you will have to restart Emacs."
    :type 'boolean
    :set (lambda (symbol value)
    (set-default symbol value)
    (cond
    (value
    (add-to-list 'auto-mode-alist '("\\.m\\'" . matlab-mode)))))
    :require 'matlab)

    :load 'matlab
    :group 'emacs-goodies-el)

     
  • Peter S Galbraith

    Sorry about the last two lines. Just something for me to add for Debian.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.