diff options
| author | Stefan Monnier | 2000-10-07 03:05:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-10-07 03:05:14 +0000 |
| commit | 9ee45b2cc114ab555e45d9f030747b9c7e5a7a89 (patch) | |
| tree | 027a11e02e15bf7bc613c26da07a30cc6a0708b7 | |
| parent | 56cc166567530679ca611a3b76dd6a33e1d90f11 (diff) | |
| download | emacs-9ee45b2cc114ab555e45d9f030747b9c7e5a7a89.tar.gz emacs-9ee45b2cc114ab555e45d9f030747b9c7e5a7a89.zip | |
(set-auto-mode): Ignore unknown -*- mode -*- rather than
raise an error. This way it can still defaults to a sane value.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/files.el | 36 |
2 files changed, 26 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ef7457d88b..72e2fb27d15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-10-06 Stefan Monnier <monnier@cs.yale.edu> | 1 | 2000-10-06 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 2 | ||
| 3 | * files.el (set-auto-mode): Ignore unknown -*- mode -*- rather than | ||
| 4 | raise an error. This way it can still defaults to a sane value. | ||
| 5 | |||
| 3 | * startup.el (fancy-splash-screens): Use local rather than global map. | 6 | * startup.el (fancy-splash-screens): Use local rather than global map. |
| 4 | Don't use `update-menu-bindings' any more. | 7 | Don't use `update-menu-bindings' any more. |
| 5 | Get rid of assumptions about keymap representation. | 8 | Get rid of assumptions about keymap representation. |
| @@ -38,8 +41,8 @@ | |||
| 38 | (tex-font-lock-keywords-1): Remove. | 41 | (tex-font-lock-keywords-1): Remove. |
| 39 | (font-lock-turn-on-thing-lock): Use jit-lock-register. | 42 | (font-lock-turn-on-thing-lock): Use jit-lock-register. |
| 40 | (font-lock-turn-off-thing-lock): Use jit-lock-unregister. | 43 | (font-lock-turn-off-thing-lock): Use jit-lock-unregister. |
| 41 | (font-lock-default-fontify-region): Expand beg..end correctly | 44 | (font-lock-default-fontify-region): |
| 42 | when just following a multiline region. | 45 | Expand beg..end correctly when just following a multiline region. |
| 43 | (font-lock-fontify-anchored-keywords): | 46 | (font-lock-fontify-anchored-keywords): |
| 44 | Include the anchor text as part of the multiline. | 47 | Include the anchor text as part of the multiline. |
| 45 | 48 | ||
diff --git a/lisp/files.el b/lisp/files.el index 14a14c89cca..6fc452545e5 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -472,7 +472,7 @@ patterns and to guarantee valid names." | |||
| 472 | 472 | ||
| 473 | (defvar cd-path nil | 473 | (defvar cd-path nil |
| 474 | "Value of the CDPATH environment variable, as a list. | 474 | "Value of the CDPATH environment variable, as a list. |
| 475 | Not actually set up until the first time you you use it.") | 475 | Not actually set up until the first time you use it.") |
| 476 | 476 | ||
| 477 | (defun parse-colon-path (cd-path) | 477 | (defun parse-colon-path (cd-path) |
| 478 | "Explode a colon-separated search path into a list of directory names. | 478 | "Explode a colon-separated search path into a list of directory names. |
| @@ -1386,10 +1386,6 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1386 | ("\\.ms\\'" . nroff-mode) | 1386 | ("\\.ms\\'" . nroff-mode) |
| 1387 | ("\\.man\\'" . nroff-mode) | 1387 | ("\\.man\\'" . nroff-mode) |
| 1388 | ("\\.\\(u?lpc\\|pike\\|pmod\\)\\'" . pike-mode) | 1388 | ("\\.\\(u?lpc\\|pike\\|pmod\\)\\'" . pike-mode) |
| 1389 | ;;; The following should come after the ChangeLog pattern | ||
| 1390 | ;;; for the sake of ChangeLog.1, etc. | ||
| 1391 | ;;; and after the .scm.[0-9] pattern too. | ||
| 1392 | ("\\.[12345678]\\'" . nroff-mode) | ||
| 1393 | ("\\.TeX\\'" . tex-mode) | 1389 | ("\\.TeX\\'" . tex-mode) |
| 1394 | ("\\.sty\\'" . latex-mode) | 1390 | ("\\.sty\\'" . latex-mode) |
| 1395 | ("\\.cls\\'" . latex-mode) ;LaTeX 2e class | 1391 | ("\\.cls\\'" . latex-mode) ;LaTeX 2e class |
| @@ -1455,7 +1451,15 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1455 | ("configure\\.in\\'" . autoconf-mode) | 1451 | ("configure\\.in\\'" . autoconf-mode) |
| 1456 | ("BROWSE\\'" . ebrowse-tree-mode) | 1452 | ("BROWSE\\'" . ebrowse-tree-mode) |
| 1457 | ("\\.ebrowse\\'" . ebrowse-tree-mode) | 1453 | ("\\.ebrowse\\'" . ebrowse-tree-mode) |
| 1458 | ("#\\*mail\\*" . mail-mode))) | 1454 | ("#\\*mail\\*" . mail-mode) |
| 1455 | ;; Get rid of any trailing .n.m and try again. | ||
| 1456 | ;; This is for files saved by cvs-merge that look like .#<file>.<rev> | ||
| 1457 | ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~ | ||
| 1458 | ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t) | ||
| 1459 | ;;; The following should come after the ChangeLog pattern | ||
| 1460 | ;;; for the sake of ChangeLog.1, etc. | ||
| 1461 | ;;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. | ||
| 1462 | ("\\.[12345678]\\'" . nroff-mode))) | ||
| 1459 | "Alist of filename patterns vs corresponding major mode functions. | 1463 | "Alist of filename patterns vs corresponding major mode functions. |
| 1460 | Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). | 1464 | Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). |
| 1461 | \(NON-NIL stands for anything that is not nil; the value does not matter.) | 1465 | \(NON-NIL stands for anything that is not nil; the value does not matter.) |
| @@ -1606,18 +1610,20 @@ and we don't even do that unless it would come from the file name." | |||
| 1606 | (forward-char -1) | 1610 | (forward-char -1) |
| 1607 | (goto-char end)) | 1611 | (goto-char end)) |
| 1608 | (skip-chars-backward " \t") | 1612 | (skip-chars-backward " \t") |
| 1609 | (setq modes (cons (intern (concat (downcase (buffer-substring beg (point))) "-mode")) | 1613 | (push (intern (concat (downcase (buffer-substring beg (point))) "-mode")) |
| 1610 | modes))) | 1614 | modes)) |
| 1611 | ;; Simple -*-MODE-*- case. | 1615 | ;; Simple -*-MODE-*- case. |
| 1612 | (setq modes (cons (intern (concat (downcase (buffer-substring beg end)) | 1616 | (push (intern (concat (downcase (buffer-substring beg end)) |
| 1613 | "-mode")) | 1617 | "-mode")) |
| 1614 | modes)))))) | 1618 | modes))))) |
| 1615 | ;; If we found modes to use, invoke them now, | 1619 | ;; If we found modes to use, invoke them now, |
| 1616 | ;; outside the save-excursion. | 1620 | ;; outside the save-excursion. |
| 1617 | (when modes | 1621 | (unless just-from-file-name |
| 1618 | (unless just-from-file-name | 1622 | (dolist (mode (nreverse modes)) |
| 1619 | (mapc 'funcall (nreverse modes))) | 1623 | (if (not (functionp mode)) |
| 1620 | (setq done t)) | 1624 | (message "Ignoring unknown mode `%s'" mode) |
| 1625 | (setq done t) | ||
| 1626 | (funcall mode)))) | ||
| 1621 | ;; If we didn't find a mode from a -*- line, try using the file name. | 1627 | ;; If we didn't find a mode from a -*- line, try using the file name. |
| 1622 | (if (and (not done) buffer-file-name) | 1628 | (if (and (not done) buffer-file-name) |
| 1623 | (let ((name buffer-file-name) | 1629 | (let ((name buffer-file-name) |