From bbc67516227ac13bf1988b8a51e69bac7461e2fb Mon Sep 17 00:00:00 2001 From: Daniel Pfeiffer Date: Tue, 26 Oct 2004 21:44:20 +0000 Subject: [PATCH] (auto-mode-alist): Add pod, js, xbm and xpm and group trivial variants to shorten the list. (xml-based-modes): New var. (set-auto-mode): Give interpreter-mode-alist or + + * files.el (auto-mode-alist): Add pod, js, xbm and xpm and group + trivial variants to shorten the list. + (xml-based-modes): New var. + (set-auto-mode): Give interpreter-mode-alist or * calc/calc.el (calc,full-calc, calc-quit, calc-keypad) @@ -5,10 +21,10 @@ instead of `interactive-p'. * calc/calc-misc.el (calc-other-window): Use an extra argument - instead of `interactive-p'. + instead of `interactive-p'. - * calc/calc-rewr.el (calc-match): Use an extra argument instead of - `interactive-p'. + * calc/calc-rewr.el (calc-match): Use an extra argument instead of + `interactive-p'. 2004-10-26 Kim F. Storm diff --git a/lisp/files.el b/lisp/files.el index ee6793bec71..d14c4625352 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1646,40 +1646,33 @@ in that case, this function acts as if `enable-local-variables' were t." (lambda (elt) (cons (purecopy (car elt)) (cdr elt))) '(("\\.te?xt\\'" . text-mode) - ("\\.tex\\'" . tex-mode) + ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages. ("\\.ltx\\'" . latex-mode) ("\\.dtx\\'" . doctex-mode) ("\\.el\\'" . emacs-lisp-mode) ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) ("\\.l\\'" . lisp-mode) - ("\\.lisp\\'" . lisp-mode) - ("\\.f\\'" . fortran-mode) - ("\\.F\\'" . fortran-mode) + ("\\.li?sp\\'" . lisp-mode) + ("\\.[fF]\\'" . fortran-mode) ("\\.for\\'" . fortran-mode) ("\\.p\\'" . pascal-mode) ("\\.pas\\'" . pascal-mode) ("\\.ad[abs]\\'" . ada-mode) ("\\.ad[bs].dg\\'" . ada-mode) - ("\\.\\([pP]\\([Llm]\\|erl\\)\\|al\\)\\'" . perl-mode) + ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) ("\\.s?html?\\'" . html-mode) ("\\.mk\\'" . makefile-mode) - ("\\(M\\|m\\|GNUm\\)akefile\\'" . makefile-mode) + ("\\([Mm]\\|GNUm\\)akep*file\\'" . makefile-mode) ("\\.am\\'" . makefile-mode) ;For Automake. ;; Less common extensions come here ;; so more common ones above are found faster. ("\\.texinfo\\'" . texinfo-mode) ("\\.te?xi\\'" . texinfo-mode) - ("\\.s\\'" . asm-mode) - ("\\.S\\'" . asm-mode) + ("\\.[sS]\\'" . asm-mode) ("\\.asm\\'" . asm-mode) - ("ChangeLog\\'" . change-log-mode) - ("change\\.log\\'" . change-log-mode) - ("changelo\\'" . change-log-mode) - ("ChangeLog\\.[0-9]+\\'" . change-log-mode) - ;; for MSDOS and MS-Windows (which are case-insensitive) - ("changelog\\'" . change-log-mode) - ("changelog\\.[0-9]+\\'" . change-log-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) @@ -1688,36 +1681,27 @@ in that case, this function acts as if `enable-local-variables' were t." ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) ("\\.m?spec\\'" . sh-mode) - ("\\.mm\\'" . nroff-mode) - ("\\.me\\'" . nroff-mode) - ("\\.ms\\'" . nroff-mode) + ("\\.m[mes]\\'" . nroff-mode) ("\\.man\\'" . nroff-mode) - ("\\.TeX\\'" . tex-mode) ("\\.sty\\'" . latex-mode) - ("\\.cls\\'" . latex-mode) ;LaTeX 2e class - ("\\.clo\\'" . latex-mode) ;LaTeX 2e class option + ("\\.cl[so]\\'" . latex-mode) ;LaTeX 2e class option ("\\.bbl\\'" . latex-mode) ("\\.bib\\'" . bibtex-mode) ("\\.sql\\'" . sql-mode) - ("\\.m4\\'" . m4-mode) - ("\\.mc\\'" . m4-mode) - ("\\.mf\\'" . metafont-mode) - ("\\.mp\\'" . metapost-mode) + ("\\.m[4c]\\'" . m4-mode) + ("\\.m[fp]\\'" . metapost-mode) ("\\.vhdl?\\'" . vhdl-mode) ("\\.article\\'" . text-mode) ("\\.letter\\'" . text-mode) - ("\\.tcl\\'" . tcl-mode) + ("\\.i?tcl\\'" . tcl-mode) ("\\.exp\\'" . tcl-mode) - ("\\.itcl\\'" . tcl-mode) ("\\.itk\\'" . tcl-mode) ("\\.icn\\'" . icon-mode) ("\\.sim\\'" . simula-mode) ("\\.mss\\'" . scribe-mode) - ("\\.f90\\'" . f90-mode) - ("\\.f95\\'" . f90-mode) + ("\\.f9[05]\\'" . f90-mode) ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode ("\\.pro\\'" . idlwave-mode) - ("\\.lsp\\'" . lisp-mode) ("\\.prolog\\'" . prolog-mode) ("\\.tar\\'" . tar-mode) ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode) @@ -1733,10 +1717,11 @@ in that case, this function acts as if `enable-local-variables' were t." ("\\`/tmp/fol/" . text-mode) ("\\.oak\\'" . scheme-mode) ("\\.sgml?\\'" . sgml-mode) - ("\\.xml\\'" . sgml-mode) - ("\\.xsl\\'" . sgml-mode) + ("\\.x[ms]l\\'" . xml-mode) ("\\.dtd\\'" . sgml-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) + ("\\.js\\'" . java-mode) ; javascript-mode would be better + ("\\.x[bp]m\\'" . c-mode) ;; .emacs or .gnus or .viper following a directory delimiter in ;; Unix, MSDOG or VMS syntax. ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) @@ -1760,7 +1745,7 @@ in that case, this function acts as if `enable-local-variables' were t." ;; or .#.- or VC's .~~. ;; Using mode nil rather than `ignore' would let the search continue ;; through this list (with the shortened name) rather than start over. - ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" ignore t) + ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t) ;; The following should come after the ChangeLog pattern ;; for the sake of ChangeLog.1, etc. ;; and after the .scm.[0-9] and CVS' . patterns too. @@ -1849,12 +1834,20 @@ be interpreted by the interpreter matched by the second group of the regular expression. The mode is then determined as the mode associated with that interpreter in `interpreter-mode-alist'.") +(defvar xml-based-modes '(html-mode) + "Modes that override an XML declaration. +When `set-auto-mode' sees an