comparison lisp/files.el @ 62308:bb3ca636cd4d

(interpreter-mode-alist, auto-mode-interpreter-regexp): Doc fixes.
author Luc Teirlinck <teirllm@auburn.edu>
date Sat, 14 May 2005 00:56:30 +0000
parents bac64e3149d8
children 67ed9a824941
comparison
equal deleted inserted replaced
62307:c1584508336e 62308:bb3ca636cd4d
539 Fifth arg INITIAL specifies text to start with. 539 Fifth arg INITIAL specifies text to start with.
540 DIR should be an absolute directory name. It defaults to 540 DIR should be an absolute directory name. It defaults to
541 the value of `default-directory'." 541 the value of `default-directory'."
542 (unless dir 542 (unless dir
543 (setq dir default-directory)) 543 (setq dir default-directory))
544 (read-file-name prompt dir (or default-dirname 544 (read-file-name prompt dir (or default-dirname
545 (if initial (expand-file-name initial dir) 545 (if initial (expand-file-name initial dir)
546 dir)) 546 dir))
547 mustmatch initial 547 mustmatch initial
548 'file-directory-p)) 548 'file-directory-p))
549 549
1942 ("guile" . scheme-mode) 1942 ("guile" . scheme-mode)
1943 ("clisp" . lisp-mode))) 1943 ("clisp" . lisp-mode)))
1944 "Alist mapping interpreter names to major modes. 1944 "Alist mapping interpreter names to major modes.
1945 This is used for files whose first lines match `auto-mode-interpreter-regexp'. 1945 This is used for files whose first lines match `auto-mode-interpreter-regexp'.
1946 Each element looks like (INTERPRETER . MODE). 1946 Each element looks like (INTERPRETER . MODE).
1947 The car of each element is compared with 1947 The car of each element, a regular expression, is compared with
1948 the name of the interpreter specified in the first line. 1948 the name of the interpreter specified in the first line.
1949 If it matches, mode MODE is selected. 1949 If it matches, mode MODE is selected.
1950 1950
1951 See also `auto-mode-alist'.") 1951 See also `auto-mode-alist'.")
1952 1952
1959 from the end of the file name anything that matches one of these regexps.") 1959 from the end of the file name anything that matches one of these regexps.")
1960 1960
1961 (defvar auto-mode-interpreter-regexp 1961 (defvar auto-mode-interpreter-regexp
1962 "#![ \t]?\\([^ \t\n]*\ 1962 "#![ \t]?\\([^ \t\n]*\
1963 /bin/env[ \t]\\)?\\([^ \t\n]+\\)" 1963 /bin/env[ \t]\\)?\\([^ \t\n]+\\)"
1964 "Regular expression matching interpreters, for file mode determination. 1964 "Regexp matching interpreters, for file mode determination.
1965 This regular expression is matched against the first line of a file 1965 This regular expression is matched against the first line of a file
1966 to determine the file's mode in `set-auto-mode' when Emacs can't deduce 1966 to determine the file's mode in `set-auto-mode'. If it matches, the file
1967 a mode from the file's name. If it matches, the file is assumed to 1967 is assumed to be interpreted by the interpreter matched by the second group
1968 be interpreted by the interpreter matched by the second group of the 1968 of the regular expression. The mode is then determined as the mode
1969 regular expression. The mode is then determined as the mode associated 1969 associated with that interpreter in `interpreter-mode-alist'.")
1970 with that interpreter in `interpreter-mode-alist'.")
1971 1970
1972 (defvar magic-mode-alist 1971 (defvar magic-mode-alist
1973 `(;; The < comes before the groups (but the first) to reduce backtracking. 1972 `(;; The < comes before the groups (but the first) to reduce backtracking.
1974 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. 1973 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
1975 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 1974 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")