diff options
| author | Richard M. Stallman | 2002-03-28 18:26:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-03-28 18:26:07 +0000 |
| commit | 7078d9d20f93a350b3fc2c6fd36d70fadc75c163 (patch) | |
| tree | 3a6a173e821ae415351b9259f4d4e8ba6270e5e0 | |
| parent | 27451bb4df6ff041ffd6090bb635b094be6d9809 (diff) | |
| download | emacs-7078d9d20f93a350b3fc2c6fd36d70fadc75c163.tar.gz emacs-7078d9d20f93a350b3fc2c6fd36d70fadc75c163.zip | |
Mark many more variables as risky.
(hack-one-local-variable): Recognize several additional
patterns as risky.
| -rw-r--r-- | lisp/files.el | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 49ca52a48f3..c90e75f934b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1895,11 +1895,18 @@ is specified, returning t if it is specified." | |||
| 1895 | (put 'ignored-local-variables 'risky-local-variable t) | 1895 | (put 'ignored-local-variables 'risky-local-variable t) |
| 1896 | (put 'eval 'risky-local-variable t) | 1896 | (put 'eval 'risky-local-variable t) |
| 1897 | (put 'file-name-handler-alist 'risky-local-variable t) | 1897 | (put 'file-name-handler-alist 'risky-local-variable t) |
| 1898 | (put 'minor-mode-alist 'risky-local-variable t) | ||
| 1898 | (put 'minor-mode-map-alist 'risky-local-variable t) | 1899 | (put 'minor-mode-map-alist 'risky-local-variable t) |
| 1900 | (put 'minor-mode-overriding-map-alist 'risky-local-variable t) | ||
| 1901 | (put 'overriding-local-map 'risky-local-variable t) | ||
| 1902 | (put 'overriding-terminal-local-map 'risky-local-variable t) | ||
| 1903 | (put 'auto-mode-alist 'risky-local-variable t) | ||
| 1899 | (put 'after-load-alist 'risky-local-variable t) | 1904 | (put 'after-load-alist 'risky-local-variable t) |
| 1900 | (put 'buffer-file-name 'risky-local-variable t) | 1905 | (put 'buffer-file-name 'risky-local-variable t) |
| 1906 | (put 'buffer-undo-list 'risky-local-variable t) | ||
| 1901 | (put 'buffer-auto-save-file-name 'risky-local-variable t) | 1907 | (put 'buffer-auto-save-file-name 'risky-local-variable t) |
| 1902 | (put 'buffer-file-truename 'risky-local-variable t) | 1908 | (put 'buffer-file-truename 'risky-local-variable t) |
| 1909 | (put 'default-text-properties 'risky-local-variable t) | ||
| 1903 | (put 'exec-path 'risky-local-variable t) | 1910 | (put 'exec-path 'risky-local-variable t) |
| 1904 | (put 'load-path 'risky-local-variable t) | 1911 | (put 'load-path 'risky-local-variable t) |
| 1905 | (put 'exec-directory 'risky-local-variable t) | 1912 | (put 'exec-directory 'risky-local-variable t) |
| @@ -1910,6 +1917,20 @@ is specified, returning t if it is specified." | |||
| 1910 | (put 'outline-level 'risky-local-variable t) | 1917 | (put 'outline-level 'risky-local-variable t) |
| 1911 | (put 'rmail-output-file-alist 'risky-local-variable t) | 1918 | (put 'rmail-output-file-alist 'risky-local-variable t) |
| 1912 | (put 'font-lock-defaults 'risky-local-variable t) | 1919 | (put 'font-lock-defaults 'risky-local-variable t) |
| 1920 | (put 'special-display-buffer-names 'risky-local-variable t) | ||
| 1921 | (put 'frame-title-format 'risky-local-variable t) | ||
| 1922 | (put 'global-mode-string 'risky-local-variable t) | ||
| 1923 | (put 'header-line-format 'risky-local-variable t) | ||
| 1924 | (put 'icon-title-format 'risky-local-variable t) | ||
| 1925 | (put 'input-method-alist 'risky-local-variable t) | ||
| 1926 | (put 'vc-mode 'risky-local-variable t) | ||
| 1927 | (put 'imenu-generic-expression 'risky-local-variable t) | ||
| 1928 | (put 'imenu-index-alist 'risky-local-variable t) | ||
| 1929 | (put 'standard-input 'risky-local-variable t) | ||
| 1930 | (put 'standard-output 'risky-local-variable t) | ||
| 1931 | (put 'unread-command-events 'risky-local-variable t) | ||
| 1932 | (put 'max-lisp-eval-depth 'risky-local-variable t) | ||
| 1933 | (put 'max-specpdl-size 'risky-local-variable t) | ||
| 1913 | 1934 | ||
| 1914 | ;; This one is safe because the user gets to check it before it is used. | 1935 | ;; This one is safe because the user gets to check it before it is used. |
| 1915 | (put 'compile-command 'safe-local-variable t) | 1936 | (put 'compile-command 'safe-local-variable t) |
| @@ -1919,7 +1940,8 @@ is specified, returning t if it is specified." | |||
| 1919 | 1940 | ||
| 1920 | (defun hack-one-local-variable (var val) | 1941 | (defun hack-one-local-variable (var val) |
| 1921 | "\"Set\" one variable in a local variables spec. | 1942 | "\"Set\" one variable in a local variables spec. |
| 1922 | A few variable names are treated specially." | 1943 | A few patterns are specified so that any name which matches one |
| 1944 | is considered risky." | ||
| 1923 | (cond ((eq var 'mode) | 1945 | (cond ((eq var 'mode) |
| 1924 | (funcall (intern (concat (downcase (symbol-name val)) | 1946 | (funcall (intern (concat (downcase (symbol-name val)) |
| 1925 | "-mode")))) | 1947 | "-mode")))) |
| @@ -1932,7 +1954,7 @@ A few variable names are treated specially." | |||
| 1932 | ;; Likewise for setting hook variables. | 1954 | ;; Likewise for setting hook variables. |
| 1933 | ((or (get var 'risky-local-variable) | 1955 | ((or (get var 'risky-local-variable) |
| 1934 | (and | 1956 | (and |
| 1935 | (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$" | 1957 | (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$\\|^mode-line" |
| 1936 | (symbol-name var)) | 1958 | (symbol-name var)) |
| 1937 | (not (get var 'safe-local-variable)))) | 1959 | (not (get var 'safe-local-variable)))) |
| 1938 | ;; Permit evalling a put of a harmless property. | 1960 | ;; Permit evalling a put of a harmless property. |