auto-mode-alist
auto-mode-alist is a variable defined in `
files.el
'.
Its value is shown
below.
- This variable may be risky if used as a file-local variable.
Documentation:
Alist of filename patterns vs corresponding major mode functions.
Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
(NON-NIL stands for anything that is not nil; the value does not matter.)
Visiting a file whose name matches REGEXP specifies FUNCTION as the
mode function to use. FUNCTION will be called, unless it is nil.
If the element has the form (REGEXP FUNCTION NON-NIL), then after
calling FUNCTION (if it's not nil), we delete the suffix that matched
REGEXP and search the list again for another match.
The extensions whose FUNCTION is `archive-mode' should also
appear in `auto-coding-alist' with `no-conversion' coding system.
See also `interpreter-mode-alist', which detects executable script modes
based on the interpreters they specify to run,
and `magic-mode-alist', which determines modes based on file contents.
Value:
(("\\.adb\\.dg\\'" . ada-mode)
("\\.ads\\.dg\\'" . ada-mode)
("\\.adb\\'" . ada-mode)
("\\.ads\\'" . ada-mode)
("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file)
("\\.\\(?:3fr\\|a\\(?:r[tw]\\|vs\\)\\|bmp[23]?\\|c\\(?:als?\\|myka?\\|r[2w]\\|u[rt]\\)\\|d\\(?:c[mrx]\\|ds\\|ng\\|px\\)\\|f\\(?:ax\\|its\\)\\|gif\\(?:87\\)?\\|hrz\\|ic\\(?:on\\|[bo]\\)\\|j\\(?:\\(?:pe\\|[np]\\)g\\)\\|k\\(?:25\\|dc\\)\\|m\\(?:iff\\|ng\\|rw\\|s\\(?:l\\|vg\\)\\|tv\\)\\|nef\\|o\\(?:rf\\|tb\\)\\|p\\(?:bm\\|c\\(?:ds\\|[dltx]\\)\\|db\\|ef\\|gm\\|i\\(?:ct\\|x\\)\\|jpeg\\|n\\(?:g\\(?:24\\|32\\|8\\)\\|[gm]\\)\\|pm\\|sd\\|tif\\|wp\\)\\|r\\(?:a[fs]\\|gb[ao]?\\|l[ae]\\)\\|s\\(?:c[rt]\\|fw\\|gi\\|r[2f]\\|un\\|vgz?\\)\\|t\\(?:ga\\|i\\(?:ff\\(?:64\\)?\\|le\\|m\\)\\|tf\\)\\|uyvy\\|v\\(?:da\\|i\\(?:car\\|d\\|ff\\)\\|st\\)\\|w\\(?:bmp\\|pg\\)\\|x\\(?:3f\\|bm\\|cf\\|pm\\|wd\\|[cv]\\)\\|y\\(?:cbcra?\\|uv\\)\\)\\'" . image-mode)
("\\.elc\\'" . elisp-byte-code-mode)
("\\.dz\\'" nil jka-compr)
("\\.xz\\'" nil jka-compr)
("\\.lzma\\'" nil jka-compr)
("\\.lz\\'" nil jka-compr)
("\\.g?z\\'" nil jka-compr)
("\\.bz2\\'" nil jka-compr)
("\\.Z\\'" nil jka-compr)
("\\.vr[hi]?\\'" . vera-mode)
("\\(?:\\.rb\\|ru\\|rake\\|thor\\|jbuilder\\|rabl\\|gemspec\\|podspec\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode)
("\\.re?st\\'" . rst-mode)
("\\.py\\'" . python-mode)
("\\.scss\\'" . scss-mode)
("\\.awk\\'" . awk-mode)
("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode)
("\\.idl\\'" . idl-mode)
("\\.java\\'" . java-mode)
("\\.m\\'" . objc-mode)
("\\.ii\\'" . c++-mode)
("\\.i\\'" . c-mode)
("\\.lex\\'" . c-mode)
("\\.y\\(acc\\)?\\'" . c-mode)
("\\.[ch]\\'" . c-mode)
("\\.\\(CC?\\|HH?\\)\\'" . c++-mode)
("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
("\\.\\(cc\\|hh\\)\\'" . c++-mode)
("\\.\\(bat\\|cmd\\)\\'" . bat-mode)
("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
("\\.svgz?\\'" . image-mode)
("\\.svgz?\\'" . xml-mode)
("\\.x[bp]m\\'" . image-mode)
("\\.x[bp]m\\'" . c-mode)
("\\.p[bpgn]m\\'" . image-mode)
("\\.tiff?\\'" . image-mode)
("\\.gif\\'" . image-mode)
("\\.png\\'" . image-mode)
("\\.jpe?g\\'" . image-mode)
("\\.te?xt\\'" . text-mode)
("\\.[tT]e[xX]\\'" . tex-mode)
("\\.ins\\'" . tex-mode)
("\\.ltx\\'" . latex-mode)
("\\.dtx\\'" . doctex-mode)
("\\.org\\'" . org-mode)
("\\.el\\'" . emacs-lisp-mode)
("Project\\.ede\\'" . emacs-lisp-mode)
("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
("\\.l\\'" . lisp-mode)
("\\.li?sp\\'" . lisp-mode)
("\\.[fF]\\'" . fortran-mode)
("\\.for\\'" . fortran-mode)
("\\.p\\'" . pascal-mode)
("\\.pas\\'" . pascal-mode)
("\\.\\(dpr\\|DPR\\)\\'" . delphi-mode)
("\\.ad[abs]\\'" . ada-mode)
("\\.ad[bs].dg\\'" . ada-mode)
("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
("Imakefile\\'" . makefile-imake-mode)
("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode)
("\\.makepp\\'" . makefile-makepp-mode)
("\\.mk\\'" . makefile-gmake-mode)
("\\.make\\'" . makefile-gmake-mode)
("[Mm]akefile\\'" . makefile-gmake-mode)
("\\.am\\'" . makefile-automake-mode)
("\\.texinfo\\'" . texinfo-mode)
("\\.te?xi\\'" . texinfo-mode)
("\\.[sS]\\'" . asm-mode)
("\\.asm\\'" . asm-mode)
("\\.css\\'" . css-mode)
("\\.mixal\\'" . mixal-mode)
("\\.gcov\\'" . compilation-mode)
("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode)
("-gdb\\.gdb" . gdb-script-mode)
("[cC]hange\\.?[lL]og?\\'" . change-log-mode)
("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode)
("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
("\\.scm\\.[0-9]*\\'" . scheme-mode)
("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
("\\.bash\\'" . sh-mode)
("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode)
("\\(/\\|\\`\\)\\.\\(shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
("\\.m?spec\\'" . sh-mode)
("\\.m[mes]\\'" . nroff-mode)
("\\.man\\'" . nroff-mode)
("\\.sty\\'" . latex-mode)
("\\.cl[so]\\'" . latex-mode)
("\\.bbl\\'" . latex-mode)
("\\.bib\\'" . bibtex-mode)
("\\.bst\\'" . bibtex-style-mode)
("\\.sql\\'" . sql-mode)
("\\.m[4c]\\'" . m4-mode)
("\\.mf\\'" . metafont-mode)
("\\.mp\\'" . metapost-mode)
("\\.vhdl?\\'" . vhdl-mode)
("\\.article\\'" . text-mode)
("\\.letter\\'" . text-mode)
("\\.i?tcl\\'" . tcl-mode)
("\\.exp\\'" . tcl-mode)
("\\.itk\\'" . tcl-mode)
("\\.icn\\'" . icon-mode)
("\\.sim\\'" . simula-mode)
("\\.mss\\'" . scribe-mode)
("\\.f9[05]\\'" . f90-mode)
("\\.f0[38]\\'" . f90-mode)
("\\.indent\\.pro\\'" . fundamental-mode)
("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode)
("\\.srt\\'" . srecode-template-mode)
("\\.prolog\\'" . prolog-mode)
("\\.tar\\'" . tar-mode)
("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
("\\.oxt\\'" . archive-mode)
("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode)
("\\`/tmp/Re" . text-mode)
("/Message[0-9]*\\'" . text-mode)
("\\`/tmp/fol/" . text-mode)
("\\.oak\\'" . scheme-mode)
("\\.sgml?\\'" . sgml-mode)
("\\.x[ms]l\\'" . xml-mode)
("\\.dbk\\'" . xml-mode)
("\\.dtd\\'" . sgml-mode)
("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
("\\.jsm?\\'" . javascript-mode)
("\\.json\\'" . javascript-mode)
("\\.[ds]?vh?\\'" . verilog-mode)
("\\.by\\'" . bovine-grammar-mode)
("\\.wy\\'" . wisent-grammar-mode)
("[:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode)
("\\`\\..*emacs\\'" . emacs-lisp-mode)
("[:/]_emacs\\'" . emacs-lisp-mode)
("/crontab\\.X*[0-9]+\\'" . shell-script-mode)
("\\.ml\\'" . lisp-mode)
("\\.ld[si]?\\'" . ld-script-mode)
("ld\\.?script\\'" . ld-script-mode)
("\\.xs\\'" . c-mode)
("\\.x[abdsru]?[cnw]?\\'" . ld-script-mode)
("\\.zone\\'" . dns-mode)
("\\.soa\\'" . dns-mode)
("\\.asd\\'" . lisp-mode)
("\\.\\(asn\\|mib\\|smi\\)\\'" . snmp-mode)
("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode)
("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
("\\.\\(dif\\|pat\\)\\'" . diff-mode)
("\\.[eE]?[pP][sS]\\'" . ps-mode)
("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode)
("BROWSE\\'" . ebrowse-tree-mode)
("\\.ebrowse\\'" . ebrowse-tree-mode)
("#\\*mail\\*" . mail-mode)
("\\.g\\'" . antlr-mode)
("\\.mod\\'" . m2-mode)
("\\.ses\\'" . ses-mode)
("\\.docbook\\'" . sgml-mode)
("\\.com\\'" . dcl-mode)
("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
("\\.\\(?:desktop\\|la\\)\\'" . conf-unix-mode)
("\\.ppd\\'" . conf-ppd-mode)
("java.+\\.conf\\'" . conf-javaprop-mode)
("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode)
("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . change-log-mode)
("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
("/\\.\\(?:enigma\\|gltron\\|gtk\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode)
("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
("/X11.+app-defaults/\\|\\.ad\\'" . conf-xdefaults-mode)
("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)
("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode-maybe)
("\\.[1-9]\\'" . nroff-mode)
("\\.tgz\\'" . tar-mode)
("\\.tbz2?\\'" . tar-mode)
("\\.txz\\'" . tar-mode))