aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-10-13 14:00:48 +0000
committerRichard M. Stallman1996-10-13 14:00:48 +0000
commit93a2702d0e815c1ccedd2e238a797769c4875ef8 (patch)
tree129dc23343d37d5fd43ca001464706675eabbc42
parent00d3de8eaeb0b6cad96f56bd8f1a460fa21f2b4b (diff)
downloademacs-93a2702d0e815c1ccedd2e238a797769c4875ef8.tar.gz
emacs-93a2702d0e815c1ccedd2e238a797769c4875ef8.zip
(hack-local-variables-prop-line):
Ignore case when checking for `mode'.
-rw-r--r--lisp/files.el30
1 files changed, 25 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 3fca81b9b30..2de1dd5dee9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -235,13 +235,13 @@ See also `write-file-hooks'.")
235(make-variable-buffer-local 'write-contents-hooks) 235(make-variable-buffer-local 'write-contents-hooks)
236 236
237(defconst enable-local-variables t 237(defconst enable-local-variables t
238 "*Control use of local-variables lists in files you visit. 238 "*Control use of local variables in files you visit.
239The value can be t, nil or something else. 239The value can be t, nil or something else.
240A value of t means local-variables lists are obeyed; 240A value of t means file local variables specifications are obeyed;
241nil means they are ignored; anything else means query. 241nil means they are ignored; anything else means query.
242 242
243The command \\[normal-mode] always obeys local-variables lists 243The command \\[normal-mode] always obeys file local variable
244and ignores this variable.") 244specifications and ignores this variable.")
245 245
246(defconst enable-local-eval 'maybe 246(defconst enable-local-eval 'maybe
247 "*Control processing of the \"variable\" `eval' in a file's local variables. 247 "*Control processing of the \"variable\" `eval' in a file's local variables.
@@ -1241,7 +1241,11 @@ If `enable-local-variables' is nil, this function does not check for a
1241 (val (save-restriction 1241 (val (save-restriction
1242 (narrow-to-region (point) end) 1242 (narrow-to-region (point) end)
1243 (read (current-buffer))))) 1243 (read (current-buffer)))))
1244 (or (eq key 'mode) 1244 ;; It is traditional to ignore
1245 ;; case when checking for `mode' in set-auto-mode,
1246 ;; so we must do that here as well.
1247 ;; That is inconsistent, but we're stuck with it.
1248 (or (equal (downcase (symbol-name key)) "mode")
1245 (setq result (cons (cons key val) result))) 1249 (setq result (cons (cons key val) result)))
1246 (skip-chars-forward " \t;"))) 1250 (skip-chars-forward " \t;")))
1247 (setq result (nreverse result)))) 1251 (setq result (nreverse result))))
@@ -1687,6 +1691,22 @@ The extension, in a file name, is the part that follows the last `.'."
1687 (substring file 0 (match-beginning 0))) 1691 (substring file 0 (match-beginning 0)))
1688 filename)))) 1692 filename))))
1689 1693
1694(defun file-name-extension (filename &optional period)
1695 "Return FILENAME's final \"extension\".
1696The extension, in a file name, is the part that follows the last `.'.
1697Return nil for extensionless file names such as `foo'.
1698Return the empty string for file names such as `foo.'.
1699
1700If PERIOD is non-nil, then the returned value includes the period
1701that delimits the extension, and if FILENAME has no extension,
1702the value is \"\"."
1703 (save-match-data
1704 (let ((file (file-name-sans-versions (file-name-nondirectory filename))))
1705 (if (string-match "\\.[^.]*\\'" file)
1706 (substring file (+ (match-beginning 0) (if period 0 1)))
1707 (if period
1708 "")))))
1709
1690(defun make-backup-file-name (file) 1710(defun make-backup-file-name (file)
1691 "Create the non-numeric backup file name for FILE. 1711 "Create the non-numeric backup file name for FILE.
1692This is a separate function so you can redefine it for customization." 1712This is a separate function so you can redefine it for customization."