Sorting auto-mode-alist gives bad result

Bug #770214 reported by Reuben Thomas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
New
Undecided
Unassigned

Bug Description

Starting from emacs-Q-nxhtml, here's auto-mode-alist:

Value: (("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file)
 ("\\.dz\\'" nil jka-compr)
 ("\\.xz\\(~\\|\\.~[0-9]+~\\)?\\'" nil jka-compr)
 ("\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'" nil jka-compr)
 ("\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'" nil jka-compr)
 ("\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'" nil jka-compr)
 ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
 ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)
 ("\\.djhtml\\'" . django-nxhtml-mumamo-mode)
 ("\\.djhtml\\'" . django-html-mumamo-mode)
 ("\\.epl\\'" . embperl-nxhtml-mumamo-mode)
 ("\\.epl\\'" . embperl-html-mumamo-mode)
 ("\\.rhtml\\'" . eruby-nxhtml-mumamo-mode)
 ("\\.rhtml\\'" . eruby-html-mumamo-mode)
 ("\\.ghtml\\'" . genshi-nxhtml-mumamo-mode)
 ("\\.ghtml\\'" . genshi-html-mumamo-mode)
 ("\\.jsp\\'" . jsp-nxhtml-mumamo-mode)
 ("\\.jsp\\'" . jsp-html-mumamo-mode)
 ("\\.lzx\\'" . laszlo-nxml-mumamo-mode)
 ("\\.phps\\'" . smarty-nxhtml-mumamo-mode)
 ("\\.phps\\'" . smarty-html-mumamo-mode)
 ("\\.phtml\\'" . nxhtml-mumamo-mode)
 ("\\.php\\'" . nxhtml-mumamo-mode)
 ("\\.xhtmlf\\'" . nxhtml-mumamo-mode)
 ("\\.htmlf\\'" . nxhtml-mumamo-mode)
 ("\\.xhtml\\'" . nxhtml-mumamo-mode)
 ("\\.xhtm\\'" . nxhtml-mumamo-mode)
 ("\\.html\\'" . nxhtml-mumamo-mode)
 ("\\.htm\\'" . nxhtml-mumamo-mode)
 ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . nxhtml-mumamo-mode)
 ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mumamo-mode)
 ("\\.htm\\'" . html-mumamo-mode)
 ("\\.html\\'" . html-mumamo-mode)
 ("\\.xhtm\\'" . html-mumamo-mode)
 ("\\.xhtml\\'" . html-mumamo-mode)
 ("\\.htmlf\\'" . html-mumamo-mode)
 ("\\.xhtmlf\\'" . html-mumamo-mode)
 ("\\.php\\'" . html-mumamo-mode)
 ("\\.phtml\\'" . html-mumamo-mode)
 ("\\.dbk\\'" . nxml-mode)
 ("\\.x[ms]l\\'" . nxml-mode)
 ("\\.svgz?\\'" . nxml-mode)
 ("\\.js\\'" . javascript-mode)
 ("\\.rnc\\'" . rnc-mode)
 ("\\.gsp\\'" . gsp-html-mumamo-mode)
 ("\\.asp\\'" . asp-html-mumamo-mode)
 ("\\.mhtml\\'" . mason-html-mumamo-mode)
 ("\\.mhtml\\'" . mason-nxhtml-mumamo-mode)
 ("\\.erb\\'" . eruby-javascript-mumamo-mode)
 ("\\.asp\\'" . asp-nxhtml-mumamo-mode)
 ("\\.gsp\\'" . gsp-nxhtml-mumamo-mode)
 ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . nxhtml-mode)
 ("\\.cs$" . csharp-mode)
 ("\\.vr[hi]?\\'" . vera-mode)
 ("\\.rb\\'" . ruby-mode)
 ("\\.re?st\\'" . rst-mode)
 ("\\.py\\'" . python-mode)
 ("\\.mixal\\'" . mixal-mode)
 ("\\.x[bdsru]?[cn]?\\'" . ld-script-mode)
 ("ld\\.?script\\>" . ld-script-mode)
 ("\\.ld[si]?\\>" . ld-script-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)
 ("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode)
 ("\\.soa\\'" . dns-mode)
 ("\\.css\\'" . css-mode)
 ("\\.gcov\\'" . compilation-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)
 ("\\.bst\\'" . bibtex-style-mode)
 ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-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)
 ("[Mm]akefile\\'" . makefile-gmake-mode)
 ("\\.am\\'" . makefile-automake-mode)
 ("\\.texinfo\\'" . texinfo-mode)
 ("\\.te?xi\\'" . texinfo-mode)
 ("\\.[sS]\\'" . asm-mode)
 ("\\.asm\\'" . asm-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)
 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
 ("\\.bash\\'" . sh-mode)
 ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode)
 ("\\(/\\|\\`\\)\\.\\(bash_logout\\|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)
 ("\\.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)
 ("\\.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\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode)
 ("\\.\\(sx[dmicw]\\|od[fgpst]\\|oxt\\)\\'" . archive-mode)
 ("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode)
 ("\\`/tmp/Re" . text-mode)
 ("/Message[0-9]*\\'" . text-mode)
 ("\\.zone\\'" . zone-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)
 ("\\.js\\'" . js-mode)
 ("\\.[ds]?vh?\\'" . verilog-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)
 ("\\.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\\|pdf\\|dvi\\)\\'" . doc-view-mode)
 ("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)
 ("\\.ses\\'" . ses-mode)
 ("\\.\\(soa\\|zone\\)\\'" . dns-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)
 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode-maybe)
 ("\\`/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/" . conf-xdefaults-mode)
 ("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
 ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
 ("\\.[1-9]\\'" . nroff-mode)
 ("\\.tgz\\'" . tar-mode)
 ("\\.tbz2?\\'" . tar-mode))

The problem here is that the line which strips ".in" (search for ":orig" to find it), which originates in Emacs's files.el, has been moved near the top. This overrides Emacs's default rule for configure.in to be opened in autoconf-mode.

I cannot easily understand the sorting code, sorry, but it seems that something has gone wrong here.

I have turned off sorting in majmodpri for now, but this is obviously not ideal!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.