diff options
| author | Chong Yidong | 2006-02-14 03:47:00 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-02-14 03:47:00 +0000 |
| commit | dd60bebe07d9fc5a6954d306269553d09e715de2 (patch) | |
| tree | 1784dd920b5d5fd47055c32cefcf95bff6901138 | |
| parent | 51a39bab2e2c7de59181e6d6db171a5a45f435d3 (diff) | |
| download | emacs-dd60bebe07d9fc5a6954d306269553d09e715de2.tar.gz emacs-dd60bebe07d9fc5a6954d306269553d09e715de2.zip | |
* files.el (hack-local-variables): Only set results if they
exist.
| -rw-r--r-- | lisp/files.el | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/lisp/files.el b/lisp/files.el index e96aace0467..0096916ce0b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2439,34 +2439,35 @@ is specified, returning t if it is specified." | |||
| 2439 | ;; variables (if MODE-ONLY is nil.) | 2439 | ;; variables (if MODE-ONLY is nil.) |
| 2440 | (if mode-only | 2440 | (if mode-only |
| 2441 | result | 2441 | result |
| 2442 | (setq result (nreverse result)) | 2442 | (when result |
| 2443 | (dolist (ignored ignored-local-variables) | 2443 | (setq result (nreverse result)) |
| 2444 | (setq result (assq-delete-all ignored result))) | 2444 | (dolist (ignored ignored-local-variables) |
| 2445 | (if (null enable-local-eval) | 2445 | (setq result (assq-delete-all ignored result))) |
| 2446 | (setq result (assq-delete-all 'eval result))) | 2446 | (if (null enable-local-eval) |
| 2447 | ;; Find those variables that we may want to save to | 2447 | (setq result (assq-delete-all 'eval result))) |
| 2448 | ;; `safe-local-variable-values'. | 2448 | ;; Find those variables that we may want to save to |
| 2449 | (let (risky-vars unsafe-vars) | 2449 | ;; `safe-local-variable-values'. |
| 2450 | (dolist (elt result) | 2450 | (let (risky-vars unsafe-vars) |
| 2451 | (let ((var (car elt)) | 2451 | (dolist (elt result) |
| 2452 | (val (cdr elt))) | 2452 | (let ((var (car elt)) |
| 2453 | (or (eq var 'mode) | 2453 | (val (cdr elt))) |
| 2454 | (and (eq var 'eval) | 2454 | (or (eq var 'mode) |
| 2455 | (or (eq enable-local-eval t) | 2455 | (and (eq var 'eval) |
| 2456 | (hack-one-local-variable-eval-safep | 2456 | (or (eq enable-local-eval t) |
| 2457 | (eval (quote val))))) | 2457 | (hack-one-local-variable-eval-safep |
| 2458 | (safe-local-variable-p var val) | 2458 | (eval (quote val))))) |
| 2459 | (and (risky-local-variable-p var val) | 2459 | (safe-local-variable-p var val) |
| 2460 | (push elt risky-vars)) | 2460 | (and (risky-local-variable-p var val) |
| 2461 | (push elt unsafe-vars)))) | 2461 | (push elt risky-vars)) |
| 2462 | (if (or (and (eq enable-local-variables t) | 2462 | (push elt unsafe-vars)))) |
| 2463 | (null unsafe-vars) | 2463 | (if (or (and (eq enable-local-variables t) |
| 2464 | (null risky-vars)) | 2464 | (null unsafe-vars) |
| 2465 | (hack-local-variables-confirm | 2465 | (null risky-vars)) |
| 2466 | result unsafe-vars risky-vars)) | 2466 | (hack-local-variables-confirm |
| 2467 | (dolist (elt result) | 2467 | result unsafe-vars risky-vars)) |
| 2468 | (hack-one-local-variable (car elt) (cdr elt))))) | 2468 | (dolist (elt result) |
| 2469 | (run-hooks 'hack-local-variables-hook))))) | 2469 | (hack-one-local-variable (car elt) (cdr elt))))) |
| 2470 | (run-hooks 'hack-local-variables-hook)))))) | ||
| 2470 | 2471 | ||
| 2471 | (defvar ignored-local-variables | 2472 | (defvar ignored-local-variables |
| 2472 | '(ignored-local-variables safe-local-variable-values) | 2473 | '(ignored-local-variables safe-local-variable-values) |