1862 |
(put 'ignored-local-variables 'risky-local-variable t) |
(put 'ignored-local-variables 'risky-local-variable t) |
1863 |
(put 'eval 'risky-local-variable t) |
(put 'eval 'risky-local-variable t) |
1864 |
(put 'file-name-handler-alist 'risky-local-variable t) |
(put 'file-name-handler-alist 'risky-local-variable t) |
1865 |
|
(put 'minor-mode-alist 'risky-local-variable t) |
1866 |
(put 'minor-mode-map-alist 'risky-local-variable t) |
(put 'minor-mode-map-alist 'risky-local-variable t) |
1867 |
|
(put 'minor-mode-overriding-map-alist 'risky-local-variable t) |
1868 |
|
(put 'overriding-local-map 'risky-local-variable t) |
1869 |
|
(put 'overriding-terminal-local-map 'risky-local-variable t) |
1870 |
|
(put 'auto-mode-alist 'risky-local-variable t) |
1871 |
(put 'after-load-alist 'risky-local-variable t) |
(put 'after-load-alist 'risky-local-variable t) |
1872 |
(put 'buffer-file-name 'risky-local-variable t) |
(put 'buffer-file-name 'risky-local-variable t) |
1873 |
|
(put 'buffer-undo-list 'risky-local-variable t) |
1874 |
(put 'buffer-auto-save-file-name 'risky-local-variable t) |
(put 'buffer-auto-save-file-name 'risky-local-variable t) |
1875 |
(put 'buffer-file-truename 'risky-local-variable t) |
(put 'buffer-file-truename 'risky-local-variable t) |
1876 |
|
(put 'default-text-properties 'risky-local-variable t) |
1877 |
(put 'exec-path 'risky-local-variable t) |
(put 'exec-path 'risky-local-variable t) |
1878 |
(put 'load-path 'risky-local-variable t) |
(put 'load-path 'risky-local-variable t) |
1879 |
(put 'exec-directory 'risky-local-variable t) |
(put 'exec-directory 'risky-local-variable t) |
1883 |
;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. |
;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. |
1884 |
(put 'outline-level 'risky-local-variable t) |
(put 'outline-level 'risky-local-variable t) |
1885 |
(put 'rmail-output-file-alist 'risky-local-variable t) |
(put 'rmail-output-file-alist 'risky-local-variable t) |
1886 |
|
(put 'special-display-buffer-names 'risky-local-variable t) |
1887 |
|
(put 'frame-title-format 'risky-local-variable t) |
1888 |
|
(put 'global-mode-string 'risky-local-variable t) |
1889 |
|
(put 'header-line-format 'risky-local-variable t) |
1890 |
|
(put 'icon-title-format 'risky-local-variable t) |
1891 |
|
(put 'input-method-alist 'risky-local-variable t) |
1892 |
|
(put 'format-alist 'risky-local-variable t) |
1893 |
|
(put 'vc-mode 'risky-local-variable t) |
1894 |
|
(put 'imenu-generic-expression 'risky-local-variable t) |
1895 |
|
(put 'imenu-index-alist 'risky-local-variable t) |
1896 |
|
(put 'standard-input 'risky-local-variable t) |
1897 |
|
(put 'standard-output 'risky-local-variable t) |
1898 |
|
(put 'unread-command-events 'risky-local-variable t) |
1899 |
|
(put 'max-lisp-eval-depth 'risky-local-variable t) |
1900 |
|
(put 'max-specpdl-size 'risky-local-variable t) |
1901 |
|
(put 'mode-line-format 'risky-local-variable t) |
1902 |
|
(put 'mode-line-modified 'risky-local-variable t) |
1903 |
|
(put 'mode-line-mule-info 'risky-local-variable t) |
1904 |
|
(put 'mode-line-buffer-identification 'risky-local-variable t) |
1905 |
|
(put 'mode-line-modes 'risky-local-variable t) |
1906 |
|
(put 'mode-line-position 'risky-local-variable t) |
1907 |
|
|
1908 |
;; This one is safe because the user gets to check it before it is used. |
;; This one is safe because the user gets to check it before it is used. |
1909 |
(put 'compile-command 'safe-local-variable t) |
(put 'compile-command 'safe-local-variable t) |
1913 |
|
|
1914 |
(defun hack-one-local-variable (var val) |
(defun hack-one-local-variable (var val) |
1915 |
"\"Set\" one variable in a local variables spec. |
"\"Set\" one variable in a local variables spec. |
1916 |
A few variable names are treated specially." |
A few patterns are specified so that any name which matches one |
1917 |
|
is considered risky." |
1918 |
(cond ((eq var 'mode) |
(cond ((eq var 'mode) |
1919 |
(funcall (intern (concat (downcase (symbol-name val)) |
(funcall (intern (concat (downcase (symbol-name val)) |
1920 |
"-mode")))) |
"-mode")))) |
1927 |
;; Likewise for setting hook variables. |
;; Likewise for setting hook variables. |
1928 |
((or (get var 'risky-local-variable) |
((or (get var 'risky-local-variable) |
1929 |
(and |
(and |
1930 |
(string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$" |
(string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$" |
1931 |
(symbol-name var)) |
(symbol-name var)) |
1932 |
(not (get var 'safe-local-variable)))) |
(not (get var 'safe-local-variable)))) |
1933 |
;; Permit evalling a put of a harmless property. |
;; Permit evalling a put of a harmless property. |
1964 |
(message "Ignoring `eval:' in the local variables list"))) |
(message "Ignoring `eval:' in the local variables list"))) |
1965 |
;; Ordinary variable, really set it. |
;; Ordinary variable, really set it. |
1966 |
(t (make-local-variable var) |
(t (make-local-variable var) |
1967 |
|
;; Make sure the string has no text properties. |
1968 |
|
;; Some text properties can get evaluated in various ways, |
1969 |
|
;; so it is risky to put them on with a local variable list. |
1970 |
|
(if (stringp val) |
1971 |
|
(set-text-properties 0 (length val) nil val)) |
1972 |
(set var val)))) |
(set var val)))) |
1973 |
|
|
1974 |
|
|
3450 |
relative to the current default directory, `default-directory'. |
relative to the current default directory, `default-directory'. |
3451 |
The file names returned are normally also relative to the current |
The file names returned are normally also relative to the current |
3452 |
default directory. However, if FULL is non-nil, they are absolute." |
default directory. However, if FULL is non-nil, they are absolute." |
3453 |
(let* ((nondir (file-name-nondirectory pattern)) |
(save-match-data |
3454 |
(dirpart (file-name-directory pattern)) |
(let* ((nondir (file-name-nondirectory pattern)) |
3455 |
;; A list of all dirs that DIRPART specifies. |
(dirpart (file-name-directory pattern)) |
3456 |
;; This can be more than one dir |
;; A list of all dirs that DIRPART specifies. |
3457 |
;; if DIRPART contains wildcards. |
;; This can be more than one dir |
3458 |
(dirs (if (and dirpart (string-match "[[*?]" dirpart)) |
;; if DIRPART contains wildcards. |
3459 |
(mapcar 'file-name-as-directory |
(dirs (if (and dirpart (string-match "[[*?]" dirpart)) |
3460 |
(file-expand-wildcards (directory-file-name dirpart))) |
(mapcar 'file-name-as-directory |
3461 |
(list dirpart))) |
(file-expand-wildcards |
3462 |
contents) |
(directory-file-name dirpart))) |
3463 |
(while dirs |
(list dirpart))) |
3464 |
(when (or (null (car dirs)) ; Possible if DIRPART is not wild. |
contents) |
3465 |
(file-directory-p (directory-file-name (car dirs)))) |
(while dirs |
3466 |
(let ((this-dir-contents |
(when (or (null (car dirs)) ; Possible if DIRPART is not wild. |
3467 |
;; Filter out "." and ".." |
(file-directory-p (directory-file-name (car dirs)))) |
3468 |
(delq nil |
(let ((this-dir-contents |
3469 |
(mapcar #'(lambda (name) |
;; Filter out "." and ".." |
3470 |
(unless (string-match "\\`\\.\\.?\\'" |
(delq nil |
3471 |
(file-name-nondirectory name)) |
(mapcar #'(lambda (name) |
3472 |
name)) |
(unless (string-match |
3473 |
(directory-files (or (car dirs) ".") full |
"\\`\\.\\.?\\'" |
3474 |
(wildcard-to-regexp nondir)))))) |
(file-name-nondirectory name)) |
3475 |
(setq contents |
name)) |
3476 |
(nconc |
(directory-files (or (car dirs) ".") full |
3477 |
(if (and (car dirs) (not full)) |
(wildcard-to-regexp nondir)))))) |
3478 |
(mapcar (function (lambda (name) (concat (car dirs) name))) |
(setq contents |
3479 |
this-dir-contents) |
(nconc |
3480 |
this-dir-contents) |
(if (and (car dirs) (not full)) |
3481 |
contents)))) |
(mapcar |
3482 |
(setq dirs (cdr dirs))) |
(function (lambda (name) (concat (car dirs) name))) |
3483 |
contents)) |
this-dir-contents) |
3484 |
|
this-dir-contents) |
3485 |
|
contents)))) |
3486 |
|
(setq dirs (cdr dirs))) |
3487 |
|
contents))) |
3488 |
|
|
3489 |
(defun list-directory (dirname &optional verbose) |
(defun list-directory (dirname &optional verbose) |
3490 |
"Display a list of files in or matching DIRNAME, a la `ls'. |
"Display a list of files in or matching DIRNAME, a la `ls'. |