diff options
| author | Masatake YAMATO | 2006-01-17 18:11:53 +0000 |
|---|---|---|
| committer | Masatake YAMATO | 2006-01-17 18:11:53 +0000 |
| commit | 3968c89ffe41372c3188f1d695a21dd2d9b9ea22 (patch) | |
| tree | 05ac7b91fdbb52abd6ce5b8428fda3bbd3b32098 | |
| parent | 11b07c376294c4a578177f136386a8ecccc8de39 (diff) | |
| download | emacs-3968c89ffe41372c3188f1d695a21dd2d9b9ea22.tar.gz emacs-3968c89ffe41372c3188f1d695a21dd2d9b9ea22.zip | |
Added makefile-imake-mode.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/files.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/make-mode.el | 40 |
4 files changed, 55 insertions, 3 deletions
| @@ -1876,9 +1876,9 @@ subprocess are controlled by the user options `scheme-trace-command', | |||
| 1876 | `scheme-untrace-command' and `scheme-expand-current-form'. | 1876 | `scheme-untrace-command' and `scheme-expand-current-form'. |
| 1877 | 1877 | ||
| 1878 | --- | 1878 | --- |
| 1879 | ** Makefile mode has submodes for automake, gmake, makepp and BSD make. | 1879 | ** Makefile mode has submodes for automake, gmake, makepp, BSD make and imake. |
| 1880 | 1880 | ||
| 1881 | The former two couldn't be differentiated before, and the latter two | 1881 | The former two couldn't be differentiated before, and the latter three |
| 1882 | are new. Font-locking is robust now and offers new customizable | 1882 | are new. Font-locking is robust now and offers new customizable |
| 1883 | faces. | 1883 | faces. |
| 1884 | 1884 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d81b2ed6a8b..3c747c3d346 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2006-01-18 Masatake YAMATO <jet@gyve.org> | ||
| 2 | |||
| 3 | * progmodes/make-mode.el (makefile-imake-mode): New mode | ||
| 4 | derived from maiefile-mode. | ||
| 5 | (makefile-imake-mode-syntax-table): New syntax table | ||
| 6 | derived from makefile-mode-syntax-table. | ||
| 7 | (makefile-mode): Write about makefile-imake-mode in | ||
| 8 | doc string. | ||
| 9 | (makefile-mode-map): Bind "\C-c\C-m\C-i" to makefile-imake-mode. | ||
| 10 | (makefile-imake-font-lock-keywords): New font lock keywords. | ||
| 11 | |||
| 12 | * files.el (auto-mode-alist): Added Imakefile. | ||
| 13 | |||
| 1 | 2006-01-17 Agustin Martin <agustin.martin@hispalinux.es> | 14 | 2006-01-17 Agustin Martin <agustin.martin@hispalinux.es> |
| 2 | 15 | ||
| 3 | * textmodes/flyspell.el (ispell-kill-ispell-hook): Add to the hook when | 16 | * textmodes/flyspell.el (ispell-kill-ispell-hook): Add to the hook when |
diff --git a/lisp/files.el b/lisp/files.el index 2b439e20d3f..d1202f99d3a 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1812,6 +1812,7 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1812 | ("\\.ad[abs]\\'" . ada-mode) | 1812 | ("\\.ad[abs]\\'" . ada-mode) |
| 1813 | ("\\.ad[bs].dg\\'" . ada-mode) | 1813 | ("\\.ad[bs].dg\\'" . ada-mode) |
| 1814 | ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) | 1814 | ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) |
| 1815 | ("Imakefile\\'" . makefile-imake-mode) | ||
| 1815 | ,@(if (memq system-type '(berkeley-unix next-mach darwin)) | 1816 | ,@(if (memq system-type '(berkeley-unix next-mach darwin)) |
| 1816 | '(("\\.mk\\'" . makefile-bsdmake-mode) | 1817 | '(("\\.mk\\'" . makefile-bsdmake-mode) |
| 1817 | ("GNUmakefile\\'" . makefile-gmake-mode) | 1818 | ("GNUmakefile\\'" . makefile-gmake-mode) |
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 4665e2cb7c0..42a021ec692 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -489,6 +489,19 @@ not be enclosed in { } or ( )." | |||
| 489 | "^\\(?: [ \t]*\\)?\\.\\(?:el\\)?if\\(n?\\)\\(?:def\\|make\\)?\\>[ \t]*\\(!?\\)" | 489 | "^\\(?: [ \t]*\\)?\\.\\(?:el\\)?if\\(n?\\)\\(?:def\\|make\\)?\\>[ \t]*\\(!?\\)" |
| 490 | '("^[ \t]*\\.for[ \t].+[ \t]\\(in\\)\\>" 1 font-lock-keyword-face))) | 490 | '("^[ \t]*\\.for[ \t].+[ \t]\\(in\\)\\>" 1 font-lock-keyword-face))) |
| 491 | 491 | ||
| 492 | (defconst makefile-imake-font-lock-keywords | ||
| 493 | (append | ||
| 494 | (makefile-make-font-lock-keywords | ||
| 495 | makefile-var-use-regex | ||
| 496 | makefile-statements | ||
| 497 | t | ||
| 498 | nil | ||
| 499 | '("^XCOMM.*$" . font-lock-comment-face) | ||
| 500 | '("XVAR\\(?:use\\|def\\)[0-9]" 0 font-lock-keyword-face prepend) | ||
| 501 | '("@@" . font-lock-preprocessor-face) | ||
| 502 | ) | ||
| 503 | cpp-font-lock-keywords)) | ||
| 504 | |||
| 492 | 505 | ||
| 493 | (defconst makefile-font-lock-syntactic-keywords | 506 | (defconst makefile-font-lock-syntactic-keywords |
| 494 | ;; From sh-script.el. | 507 | ;; From sh-script.el. |
| @@ -581,6 +594,7 @@ The function must satisfy this calling convention: | |||
| 581 | (define-key map "\C-c\C-m\C-a" 'makefile-automake-mode) | 594 | (define-key map "\C-c\C-m\C-a" 'makefile-automake-mode) |
| 582 | (define-key map "\C-c\C-m\C-b" 'makefile-bsdmake-mode) | 595 | (define-key map "\C-c\C-m\C-b" 'makefile-bsdmake-mode) |
| 583 | (define-key map "\C-c\C-m\C-g" 'makefile-gmake-mode) | 596 | (define-key map "\C-c\C-m\C-g" 'makefile-gmake-mode) |
| 597 | (define-key map "\C-c\C-m\C-i" 'makefile-imake-mode) | ||
| 584 | (define-key map "\C-c\C-m\C-m" 'makefile-mode) | 598 | (define-key map "\C-c\C-m\C-m" 'makefile-mode) |
| 585 | (define-key map "\C-c\C-m\C-p" 'makefile-makepp-mode) | 599 | (define-key map "\C-c\C-m\C-p" 'makefile-makepp-mode) |
| 586 | (define-key map "\M-p" 'makefile-previous-dependency) | 600 | (define-key map "\M-p" 'makefile-previous-dependency) |
| @@ -639,6 +653,15 @@ The function must satisfy this calling convention: | |||
| 639 | (modify-syntax-entry ?# "< " makefile-mode-syntax-table) | 653 | (modify-syntax-entry ?# "< " makefile-mode-syntax-table) |
| 640 | (modify-syntax-entry ?\n "> " makefile-mode-syntax-table)) | 654 | (modify-syntax-entry ?\n "> " makefile-mode-syntax-table)) |
| 641 | 655 | ||
| 656 | (defvar makefile-imake-mode-syntax-table (copy-syntax-table | ||
| 657 | makefile-mode-syntax-table)) | ||
| 658 | (if makefile-imake-mode-syntax-table | ||
| 659 | () | ||
| 660 | (modify-syntax-entry ?/ ". 14" makefile-imake-mode-syntax-table) | ||
| 661 | (modify-syntax-entry ?* ". 23" makefile-imake-mode-syntax-table) | ||
| 662 | (modify-syntax-entry ?# "'" makefile-imake-mode-syntax-table) | ||
| 663 | (modify-syntax-entry ?\n ". b" makefile-imake-mode-syntax-table)) | ||
| 664 | |||
| 642 | 665 | ||
| 643 | ;;; ------------------------------------------------------------ | 666 | ;;; ------------------------------------------------------------ |
| 644 | ;;; Internal variables. | 667 | ;;; Internal variables. |
| @@ -701,7 +724,8 @@ The function must satisfy this calling convention: | |||
| 701 | 724 | ||
| 702 | If you are editing a file for a different make, try one of the | 725 | If you are editing a file for a different make, try one of the |
| 703 | variants `makefile-automake-mode', `makefile-gmake-mode', | 726 | variants `makefile-automake-mode', `makefile-gmake-mode', |
| 704 | `makefile-makepp-mode' or `makefile-bsdmake-mode'. All but the | 727 | `makefile-makepp-mode', `makefile-bsdmake-mode' or, |
| 728 | `makefile-imake-mode'All but the | ||
| 705 | last should be correctly chosen based on the file name, except if | 729 | last should be correctly chosen based on the file name, except if |
| 706 | it is *.mk. This function ends by invoking the function(s) | 730 | it is *.mk. This function ends by invoking the function(s) |
| 707 | `makefile-mode-hook'. | 731 | `makefile-mode-hook'. |
| @@ -885,6 +909,20 @@ Makefile mode can be configured by modifying the following variables: | |||
| 885 | (setq font-lock-defaults | 909 | (setq font-lock-defaults |
| 886 | `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)))) | 910 | `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)))) |
| 887 | 911 | ||
| 912 | ;;;###autoload | ||
| 913 | (define-derived-mode makefile-imake-mode makefile-mode "Imakefile" | ||
| 914 | "An adapted `makefile-mode' that knows about imake." | ||
| 915 | :syntax-table makefile-imake-mode-syntax-table | ||
| 916 | (let ((base `(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults))) | ||
| 917 | new) | ||
| 918 | ;; Remove `font-lock-syntactic-keywords' entry from font-lock-defaults. | ||
| 919 | (mapc (lambda (elt) | ||
| 920 | (unless (and (consp elt) | ||
| 921 | (eq (car elt) 'font-lock-syntactic-keywords)) | ||
| 922 | (setq new (cons elt new)))) | ||
| 923 | base) | ||
| 924 | (setq font-lock-defaults (nreverse new)))) | ||
| 925 | |||
| 888 | 926 | ||
| 889 | 927 | ||
| 890 | ;;; Motion code. | 928 | ;;; Motion code. |