Mercurial > hg > xemacs-beta
comparison lisp/files.el @ 1024:ccaf90c5a53a
[xemacs-hg @ 2002-10-02 09:29:37 by stephent]
21.4 -> R21.5 stuff
manual improvements <87k7l1p6su.fsf@tleepslib.sk.tsukuba.ac.jp>
regexp tests <87fzvpp6mf.fsf@tleepslib.sk.tsukuba.ac.jp>
add-to-list doc Ville Skyttä <87bs6dp6io.fsf@tleepslib.sk.tsukuba.ac.jp>
Move filename associations Ville Skyttä <877kh1p6ee.fsf@tleepslib.sk.tsukuba.ac.jp>
lookup-syntax-properties <87admil2e0.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
fix stale submatches <873crpp50v.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
info for developers <87y99hnqc4.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Wed, 02 Oct 2002 09:31:40 +0000 |
parents | 5df795348f45 |
children | 1b0339b048ce |
comparison
equal
deleted
inserted
replaced
1023:ce9bdd48654f | 1024:ccaf90c5a53a |
---|---|
1220 :operation "File local-variables" | 1220 :operation "File local-variables" |
1221 :class 'local-variables | 1221 :class 'local-variables |
1222 :error-form nil | 1222 :error-form nil |
1223 (hack-local-variables (not find-file))))) | 1223 (hack-local-variables (not find-file))))) |
1224 | 1224 |
1225 ;; #### This variable sucks in the package model. There should be a | 1225 ;; `auto-mode-alist' used to contain entries for modes in core and in packages. |
1226 ;; way for new packages to add their entries to auto-mode-alist in a | 1226 ;; The applicable entries are now located in the corresponding modes in |
1227 ;; clean way. Per Abrahamsen suggested splitting auto-mode-alist to | 1227 ;; packages, the ones here are for core modes. Ditto for |
1228 ;; `interpreter-mode-alist' below. | |
1229 ;; Per Abrahamsen suggested splitting auto-mode-alist to | |
1228 ;; several distinct variables such as, in order of precedence, | 1230 ;; several distinct variables such as, in order of precedence, |
1229 ;; `user-auto-mode-alist' for users, `package-auto-mode-alist' for | 1231 ;; `user-auto-mode-alist' for users, `package-auto-mode-alist' for |
1230 ;; packages and `auto-mode-alist' (which might also be called | 1232 ;; packages and `auto-mode-alist' (which might also be called |
1231 ;; `default-auto-mode-alist') for default stuff, such as some of the | 1233 ;; `default-auto-mode-alist') for default stuff, such as some of the |
1232 ;; entries below. | 1234 ;; entries below. |
1233 | 1235 |
1234 (defvar auto-mode-alist | 1236 (defvar auto-mode-alist |
1235 '(("\\.te?xt\\'" . text-mode) | 1237 '(("\\.te?xt\\'" . text-mode) |
1236 ("\\.[chi]\\'" . c-mode) | |
1237 ("\\.el\\'" . emacs-lisp-mode) | 1238 ("\\.el\\'" . emacs-lisp-mode) |
1238 ("\\.\\(?:[CH]\\|cc\\|hh\\)\\'" . c++-mode) | |
1239 ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) | |
1240 ("\\.java\\'" . java-mode) | |
1241 ("\\.idl\\'" . idl-mode) | |
1242 ("\\.f\\(?:or\\)?\\'" . fortran-mode) | |
1243 ("\\.F\\(?:OR\\)?\\'" . fortran-mode) | |
1244 ("\\.[fF]90\\'" . f90-mode) | |
1245 ;;; Less common extensions come here | |
1246 ;;; so more common ones above are found faster. | |
1247 ("\\.\\([pP][Llm]\\|al\\)\\'" . perl-mode) | |
1248 ("\\.py\\'" . python-mode) | |
1249 ("\\.texi\\(?:nfo\\)?\\'" . texinfo-mode) | |
1250 ("\\.ad[abs]\\'" . ada-mode) | |
1251 ("\\.c?l\\(?:i?sp\\)?\\'" . lisp-mode) | 1239 ("\\.c?l\\(?:i?sp\\)?\\'" . lisp-mode) |
1252 ("\\.p\\(?:as\\)?\\'" . pascal-mode) | |
1253 ("\\.ltx\\'" . latex-mode) | |
1254 ("\\.[sS]\\'" . asm-mode) | |
1255 ("[Cc]hange.?[Ll]og?\\(?:.[0-9]+\\)?\\'" . change-log-mode) | |
1256 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) | |
1257 ("\\.scm?\\(?:\\.[0-9]*\\)?\\'" . scheme-mode) | |
1258 ("\\.e\\'" . eiffel-mode) | |
1259 ("\\.mss\\'" . scribe-mode) | |
1260 ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode) | |
1261 ("\\.icn\\'" . icon-mode) | |
1262 ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode) | |
1263 ("\\.[Pp][Rr][Oo]\\'" . idlwave-mode) | |
1264 ("\\.si\\(v\\|eve\\)\\'" . sieve-mode) | |
1265 ;; #### Unix-specific! | |
1266 ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode) | |
1267 ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode) | |
1268 ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode) | |
1269 ("\\.m?spec$" .sh-mode) | |
1270 ;; The following come after the ChangeLog pattern for the sake of | |
1271 ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too. | |
1272 ("\\.[123456789]\\'" . nroff-mode) | |
1273 ("\\.[tT]e[xX]\\'" . tex-mode) | |
1274 ("\\.\\(?:sty\\|cls\\|bbl\\)\\'" . latex-mode) | |
1275 ("\\.bib\\'" . bibtex-mode) | |
1276 ("\\.article\\'" . text-mode) | 1240 ("\\.article\\'" . text-mode) |
1277 ("\\.letter\\'" . text-mode) | 1241 ("\\.letter\\'" . text-mode) |
1278 ("\\.\\(?:tcl\\|exp\\)\\'" . tcl-mode) | |
1279 ("\\.wrl\\'" . vrml-mode) | |
1280 ("\\.awk\\'" . awk-mode) | |
1281 ("\\.prolog\\'" . prolog-mode) | |
1282 ("\\.\\(?:arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode) | |
1283 ;; Mailer puts message to be edited in /tmp/Re.... or Message | 1242 ;; Mailer puts message to be edited in /tmp/Re.... or Message |
1284 ;; #### Unix-specific! | 1243 ;; #### Unix-specific! |
1285 ("\\`/tmp/Re" . text-mode) | 1244 ("\\`/tmp/Re" . text-mode) |
1286 ("/Message[0-9]*\\'" . text-mode) | 1245 ("/Message[0-9]*\\'" . text-mode) |
1287 ("/drafts/[0-9]+\\'" . mh-letter-mode) | |
1288 ;; some news reader is reported to use this | 1246 ;; some news reader is reported to use this |
1289 ("^/tmp/fol/" . text-mode) | 1247 ("^/tmp/fol/" . text-mode) |
1290 ("\\.y\\'" . c-mode) | |
1291 ("\\.lex\\'" . c-mode) | |
1292 ("\\.m\\'" . objc-mode) | |
1293 ("\\.oak\\'" . scheme-mode) | |
1294 ("\\.[sj]?html?\\'" . html-mode) | |
1295 ("\\.jsp\\'" . html-mode) | |
1296 ("\\.xml\\'" . xml-mode) | |
1297 ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode) | |
1298 ("\\.c?ps\\'" . postscript-mode) | |
1299 ;; .emacs following a directory delimiter in either Unix or | 1248 ;; .emacs following a directory delimiter in either Unix or |
1300 ;; Windows syntax. | 1249 ;; Windows syntax. |
1301 ("[/\\][._].*emacs\\'" . emacs-lisp-mode) | 1250 ("[/\\][._].*emacs\\'" . emacs-lisp-mode) |
1302 ("\\.m4\\'" . autoconf-mode) | |
1303 ("configure\\.\\(in\\|ac\\)\\'" . autoconf-mode) | |
1304 ("\\.ml\\'" . lisp-mode) | 1251 ("\\.ml\\'" . lisp-mode) |
1305 ("\\.ma?ke?\\'" . makefile-mode) | |
1306 ("\\(GNU\\)?[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode) | |
1307 ("[./\\]X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode) | |
1308 ;; #### The following three are Unix-specific (but do we care?) | |
1309 ("/app-defaults/" . xrdb-mode) | |
1310 ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode) | |
1311 ("\\.\\(?:jpe?g\\|JPE?G\\|png\\|PNG\\|gif\\|GIF\\|tiff?\\|TIFF?\\)\\'" . image-mode) | |
1312 ) | 1252 ) |
1313 "Alist of filename patterns vs. corresponding major mode functions. | 1253 "Alist of filename patterns vs. corresponding major mode functions. |
1314 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). | 1254 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). |
1315 \(NON-NIL stands for anything that is not nil; the value does not matter.) | 1255 \(NON-NIL stands for anything that is not nil; the value does not matter.) |
1316 Visiting a file whose name matches REGEXP specifies FUNCTION as the | 1256 Visiting a file whose name matches REGEXP specifies FUNCTION as the |
1319 If the element has the form (REGEXP FUNCTION NON-NIL), then after | 1259 If the element has the form (REGEXP FUNCTION NON-NIL), then after |
1320 calling FUNCTION (if it's not nil), we delete the suffix that matched | 1260 calling FUNCTION (if it's not nil), we delete the suffix that matched |
1321 REGEXP and search the list again for another match.") | 1261 REGEXP and search the list again for another match.") |
1322 | 1262 |
1323 (defvar interpreter-mode-alist | 1263 (defvar interpreter-mode-alist |
1324 '(("^#!.*csh" . sh-mode) | 1264 '(("emacs" . emacs-lisp-mode)) |
1325 ("^#!.*\\b\\(scope\\|wish\\|tcl\\|tclsh\\|expect\\)" . tcl-mode) | |
1326 ("^#!.*sh\\b" . sh-mode) | |
1327 ("perl" . perl-mode) | |
1328 ("python" . python-mode) | |
1329 ("awk\\b" . awk-mode) | |
1330 ("rexx" . rexx-mode) | |
1331 ("scm\\|guile" . scheme-mode) | |
1332 ("emacs" . emacs-lisp-mode) | |
1333 ("make" . makefile-mode) | |
1334 ("^:" . sh-mode)) | |
1335 "Alist mapping interpreter names to major modes. | 1265 "Alist mapping interpreter names to major modes. |
1336 This alist is used to guess the major mode of a file based on the | 1266 This alist is used to guess the major mode of a file based on the |
1337 contents of the first line. This line often contains something like: | 1267 contents of the first line. This line often contains something like: |
1338 #!/bin/sh | 1268 #!/bin/sh |
1339 but may contain something more imaginative like | 1269 but may contain something more imaginative like |