diff options
| author | Glenn Morris | 2012-11-28 20:13:33 -0500 |
|---|---|---|
| committer | Glenn Morris | 2012-11-28 20:13:33 -0500 |
| commit | e9df8f871daa11c02b4e44a8a54584c39abd6fec (patch) | |
| tree | e71c463736756cacff828ee9327f6f5f80d8cfff | |
| parent | 4a9204fe04dee76dd067aaf1b078a777d1bb1a91 (diff) | |
| download | emacs-e9df8f871daa11c02b4e44a8a54584c39abd6fec.tar.gz emacs-e9df8f871daa11c02b4e44a8a54584c39abd6fec.zip | |
By default, ignore case when testing inhibit-local-variables (bug#10610)
* lisp/files.el (inhibit-local-variables-ignore-case): New.
(inhibit-local-variables-p): Use inhibit-local-variables-ignore-case.
Doc fix.
(inhibit-local-variables-regexps, inhibit-local-variables-suffixes):
Doc fixes.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/files.el | 18 |
2 files changed, 20 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ec3c88fbc2..5d376ceabc3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-11-29 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * files.el (inhibit-local-variables-ignore-case): New. (Bug#10610) | ||
| 4 | (inhibit-local-variables-p): Use inhibit-local-variables-ignore-case. | ||
| 5 | Doc fix. | ||
| 6 | (inhibit-local-variables-regexps, inhibit-local-variables-suffixes): | ||
| 7 | Doc fixes. | ||
| 8 | |||
| 1 | 2012-11-28 Jay Belanger <jay.p.belanger@gmail.com> | 9 | 2012-11-28 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 10 | ||
| 3 | * calc/calc-forms.el (calc-date-notation): Fix regexp | 11 | * calc/calc-forms.el (calc-date-notation): Fix regexp |
diff --git a/lisp/files.el b/lisp/files.el index 496f9bf8fa4..c22cfd69549 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2502,25 +2502,31 @@ They may happen to contain sequences that look like local variable | |||
| 2502 | specifications, but are not really, or they may be containers for | 2502 | specifications, but are not really, or they may be containers for |
| 2503 | member files with their own local variable sections, which are | 2503 | member files with their own local variable sections, which are |
| 2504 | not appropriate for the containing file. | 2504 | not appropriate for the containing file. |
| 2505 | See also `inhibit-local-variables-suffixes'.") | 2505 | The function `inhibit-local-variables-p' uses this.") |
| 2506 | 2506 | ||
| 2507 | (define-obsolete-variable-alias 'inhibit-first-line-modes-suffixes | 2507 | (define-obsolete-variable-alias 'inhibit-first-line-modes-suffixes |
| 2508 | 'inhibit-local-variables-suffixes "24.1") | 2508 | 'inhibit-local-variables-suffixes "24.1") |
| 2509 | 2509 | ||
| 2510 | (defvar inhibit-local-variables-suffixes nil | 2510 | (defvar inhibit-local-variables-suffixes nil |
| 2511 | "List of regexps matching suffixes to remove from file names. | 2511 | "List of regexps matching suffixes to remove from file names. |
| 2512 | When checking `inhibit-local-variables-regexps', we first discard | 2512 | The function `inhibit-local-variables-p' uses this: when checking |
| 2513 | from the end of the file name anything that matches one of these regexps.") | 2513 | a file name, it first discards from the end of the name anything that |
| 2514 | matches one of these regexps.") | ||
| 2515 | |||
| 2516 | ;; Can't think of any situation in which you'd want this to be nil... | ||
| 2517 | (defvar inhibit-local-variables-ignore-case t | ||
| 2518 | "Non-nil means `inhibit-local-variables-p' ignores case.") | ||
| 2514 | 2519 | ||
| 2515 | ;; TODO explicitly add case-fold-search t? | ||
| 2516 | (defun inhibit-local-variables-p () | 2520 | (defun inhibit-local-variables-p () |
| 2517 | "Return non-nil if file local variables should be ignored. | 2521 | "Return non-nil if file local variables should be ignored. |
| 2518 | This checks the file (or buffer) name against `inhibit-local-variables-regexps' | 2522 | This checks the file (or buffer) name against `inhibit-local-variables-regexps' |
| 2519 | and `inhibit-local-variables-suffixes'." | 2523 | and `inhibit-local-variables-suffixes'. If |
| 2524 | `inhibit-local-variables-ignore-case' is non-nil, this ignores case." | ||
| 2520 | (let ((temp inhibit-local-variables-regexps) | 2525 | (let ((temp inhibit-local-variables-regexps) |
| 2521 | (name (if buffer-file-name | 2526 | (name (if buffer-file-name |
| 2522 | (file-name-sans-versions buffer-file-name) | 2527 | (file-name-sans-versions buffer-file-name) |
| 2523 | (buffer-name)))) | 2528 | (buffer-name))) |
| 2529 | (case-fold-search inhibit-local-variables-ignore-case)) | ||
| 2524 | (while (let ((sufs inhibit-local-variables-suffixes)) | 2530 | (while (let ((sufs inhibit-local-variables-suffixes)) |
| 2525 | (while (and sufs (not (string-match (car sufs) name))) | 2531 | (while (and sufs (not (string-match (car sufs) name))) |
| 2526 | (setq sufs (cdr sufs))) | 2532 | (setq sufs (cdr sufs))) |