aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-04-04 21:03:15 +0000
committerGerd Moellmann2000-04-04 21:03:15 +0000
commit9ffb4859b8ee9b891d04e4d9f620d8d985d354c1 (patch)
tree71cdc1eef5ef31c778a2b27b3e4fe002b1132e48
parent8f3ff96be4edde86ab7706e580910de695a28775 (diff)
downloademacs-9ffb4859b8ee9b891d04e4d9f620d8d985d354c1.tar.gz
emacs-9ffb4859b8ee9b891d04e4d9f620d8d985d354c1.zip
Some doc fixes.
(makefile-mode-abbrev-table): New variable. (makefile-mode): Set local abbrev table to makefile-mode-abbrev-table. (makefile-font-lock-keywords): Fontify includes and conditionals. (toplevel): Require `dabbrev' and `add-log' when compiling.
-rw-r--r--lisp/progmodes/make-mode.el75
1 files changed, 48 insertions, 27 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index b2d50413fb4..2c016ec5444 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1,6 +1,6 @@
1;;; make-mode.el --- makefile editing commands for Emacs 1;;; make-mode.el --- makefile editing commands for Emacs
2 2
3;; Copyright (C) 1992, 1994 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1994, 1999, 2000 Free Software Foundation, Inc.
4 4
5;; Author: Thomas Neumann <tom@smart.bo.open.de> 5;; Author: Thomas Neumann <tom@smart.bo.open.de>
6;; Eric S. Raymond <esr@snark.thyrsus.com> 6;; Eric S. Raymond <esr@snark.thyrsus.com>
@@ -92,7 +92,9 @@
92 92
93;; Sadly we need this for a macro. 93;; Sadly we need this for a macro.
94(eval-when-compile 94(eval-when-compile
95 (require 'imenu)) 95 (require 'imenu)
96 (require 'dabbrev)
97 (require 'add-log))
96 98
97;;; ------------------------------------------------------------ 99;;; ------------------------------------------------------------
98;;; Configurable stuff 100;;; Configurable stuff
@@ -111,18 +113,18 @@
111 :group 'makemode) 113 :group 'makemode)
112 114
113(defcustom makefile-browser-buffer-name "*Macros and Targets*" 115(defcustom makefile-browser-buffer-name "*Macros and Targets*"
114 "Name of the macro- and target browser buffer." 116 "*Name of the macro- and target browser buffer."
115 :type 'string 117 :type 'string
116 :group 'makefile) 118 :group 'makefile)
117 119
118(defcustom makefile-target-colon ":" 120(defcustom makefile-target-colon ":"
119 "String to append to all target names inserted by `makefile-insert-target'. 121 "*String to append to all target names inserted by `makefile-insert-target'.
120\":\" or \"::\" are common values." 122\":\" or \"::\" are common values."
121 :type 'string 123 :type 'string
122 :group 'makefile) 124 :group 'makefile)
123 125
124(defcustom makefile-macro-assign " = " 126(defcustom makefile-macro-assign " = "
125 "String to append to all macro names inserted by `makefile-insert-macro'. 127 "*String to append to all macro names inserted by `makefile-insert-macro'.
126The normal value should be \" = \", since this is what 128The normal value should be \" = \", since this is what
127standard make expects. However, newer makes such as dmake 129standard make expects. However, newer makes such as dmake
128allow a larger variety of different macro assignments, so you 130allow a larger variety of different macro assignments, so you
@@ -131,32 +133,32 @@ might prefer to use \" += \" or \" := \" ."
131 :group 'makefile) 133 :group 'makefile)
132 134
133(defcustom makefile-electric-keys nil 135(defcustom makefile-electric-keys nil
134 "If non-nil, Makefile mode should install electric keybindings. 136 "*If non-nil, Makefile mode should install electric keybindings.
135Default is nil." 137Default is nil."
136 :type 'boolean 138 :type 'boolean
137 :group 'makefile) 139 :group 'makefile)
138 140
139(defcustom makefile-use-curly-braces-for-macros-p nil 141(defcustom makefile-use-curly-braces-for-macros-p nil
140 "Controls the style of generated macro references. 142 "*Controls the style of generated macro references.
141Non-nil means macro references should use curly braces, like `${this}'. 143Non-nil means macro references should use curly braces, like `${this}'.
142nil means use parentheses, like `$(this)'." 144nil means use parentheses, like `$(this)'."
143 :type 'boolean 145 :type 'boolean
144 :group 'makefile) 146 :group 'makefile)
145 147
146(defcustom makefile-tab-after-target-colon t 148(defcustom makefile-tab-after-target-colon t
147 "If non-nil, insert a TAB after a target colon. 149 "*If non-nil, insert a TAB after a target colon.
148Otherwise, a space is inserted. 150Otherwise, a space is inserted.
149The default is t." 151The default is t."
150 :type 'boolean 152 :type 'boolean
151 :group 'makefile) 153 :group 'makefile)
152 154
153(defcustom makefile-browser-leftmost-column 10 155(defcustom makefile-browser-leftmost-column 10
154 "Number of blanks to the left of the browser selection mark." 156 "*Number of blanks to the left of the browser selection mark."
155 :type 'integer 157 :type 'integer
156 :group 'makefile) 158 :group 'makefile)
157 159
158(defcustom makefile-browser-cursor-column 10 160(defcustom makefile-browser-cursor-column 10
159 "Column the cursor goes to when it moves up or down in the Makefile browser." 161 "*Column the cursor goes to when it moves up or down in the Makefile browser."
160 :type 'integer 162 :type 'integer
161 :group 'makefile) 163 :group 'makefile)
162 164
@@ -166,34 +168,34 @@ The default is t."
166 :group 'makefile) 168 :group 'makefile)
167 169
168(defcustom makefile-backslash-align t 170(defcustom makefile-backslash-align t
169 "If non-nil, `makefile-backslash-region' will align backslashes." 171 "*If non-nil, `makefile-backslash-region' will align backslashes."
170 :type 'boolean 172 :type 'boolean
171 :group 'makefile) 173 :group 'makefile)
172 174
173(defcustom makefile-browser-selected-mark "+ " 175(defcustom makefile-browser-selected-mark "+ "
174 "String used to mark selected entries in the Makefile browser." 176 "*String used to mark selected entries in the Makefile browser."
175 :type 'string 177 :type 'string
176 :group 'makefile) 178 :group 'makefile)
177 179
178(defcustom makefile-browser-unselected-mark " " 180(defcustom makefile-browser-unselected-mark " "
179 "String used to mark unselected entries in the Makefile browser." 181 "*String used to mark unselected entries in the Makefile browser."
180 :type 'string 182 :type 'string
181 :group 'makefile) 183 :group 'makefile)
182 184
183(defcustom makefile-browser-auto-advance-after-selection-p t 185(defcustom makefile-browser-auto-advance-after-selection-p t
184 "If non-nil, cursor will move after item is selected in Makefile browser." 186 "*If non-nil, cursor will move after item is selected in Makefile browser."
185 :type 'boolean 187 :type 'boolean
186 :group 'makefile) 188 :group 'makefile)
187 189
188(defcustom makefile-pickup-everything-picks-up-filenames-p nil 190(defcustom makefile-pickup-everything-picks-up-filenames-p nil
189 "If non-nil, `makefile-pickup-everything' picks up filenames as targets. 191 "*If non-nil, `makefile-pickup-everything' picks up filenames as targets.
190This means it calls `makefile-pickup-filenames-as-targets'. 192This means it calls `makefile-pickup-filenames-as-targets'.
191Otherwise filenames are omitted." 193Otherwise filenames are omitted."
192 :type 'boolean 194 :type 'boolean
193 :group 'makefile) 195 :group 'makefile)
194 196
195(defcustom makefile-cleanup-continuations-p t 197(defcustom makefile-cleanup-continuations-p t
196 "If non-nil, automatically clean up continuation lines when saving. 198 "*If non-nil, automatically clean up continuation lines when saving.
197A line is cleaned up by removing all whitespace following a trailing 199A line is cleaned up by removing all whitespace following a trailing
198backslash. This is done silently. 200backslash. This is done silently.
199IMPORTANT: Please note that enabling this option causes Makefile mode 201IMPORTANT: Please note that enabling this option causes Makefile mode
@@ -202,7 +204,7 @@ to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \"it seems necessary\"."
202 :group 'makefile) 204 :group 'makefile)
203 205
204(defcustom makefile-mode-hook nil 206(defcustom makefile-mode-hook nil
205 "Normal hook run by `makefile-mode'." 207 "*Normal hook run by `makefile-mode'."
206 :type 'hook 208 :type 'hook
207 :group 'makefile) 209 :group 'makefile)
208 210
@@ -220,15 +222,15 @@ to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \"it seems necessary\"."
220 ("SCCS_GET") ("SILENT") ("SOURCE") ("SUFFIXES") 222 ("SCCS_GET") ("SILENT") ("SOURCE") ("SUFFIXES")
221 ("WAIT") ("c.o") ("C.o") ("m.o") 223 ("WAIT") ("c.o") ("C.o") ("m.o")
222 ("el.elc") ("y.c") ("s.o")) 224 ("el.elc") ("y.c") ("s.o"))
223 "List of special targets. 225 "*List of special targets.
224You will be offered to complete on one of those in the minibuffer whenever 226You will be offered to complete on one of those in the minibuffer whenever
225you enter a \".\" at the beginning of a line in makefile-mode." 227you enter a \".\" at the beginning of a line in `makefile-mode'."
226 :type '(repeat (list string)) 228 :type '(repeat (list string))
227 :group 'makefile) 229 :group 'makefile)
228 230
229(defcustom makefile-runtime-macros-list 231(defcustom makefile-runtime-macros-list
230 '(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$")) 232 '(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$"))
231 "List of macros that are resolved by make at runtime. 233 "*List of macros that are resolved by make at runtime.
232If you insert a macro reference using `makefile-insert-macro-ref', the name 234If you insert a macro reference using `makefile-insert-macro-ref', the name
233of the macro is checked against this list. If it can be found its name will 235of the macro is checked against this list. If it can be found its name will
234not be enclosed in { } or ( )." 236not be enclosed in { } or ( )."
@@ -260,19 +262,29 @@ not be enclosed in { } or ( )."
260 262
261(defconst makefile-font-lock-keywords 263(defconst makefile-font-lock-keywords
262 (list 264 (list
265
263 ;; Do macro assignments. These get the "variable-name" face rather 266 ;; Do macro assignments. These get the "variable-name" face rather
264 ;; arbitrarily. 267 ;; arbitrarily.
265 (list makefile-macroassign-regex 1 'font-lock-variable-name-face) 268 (list makefile-macroassign-regex 1 'font-lock-variable-name-face)
266 ;; 269
267 ;; Do dependencies. These get the function name face. 270 ;; Do dependencies. These get the function name face.
268 (list makefile-dependency-regex 1 'font-lock-function-name-face) 271 (list makefile-dependency-regex 1 'font-lock-function-name-face)
269 ;; 272
270 ;; Variable references even in targets/strings/comments: 273 ;; Variable references even in targets/strings/comments:
271 '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend) 274 '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend)
272 ;; 275
273 ;; Automatic variable references. 276 ;; Automatic variable references.
274 '("\\$\\([@%<?^+*]\\)" 1 font-lock-reference-face prepend) 277 '("\\$\\([@%<?^+*]\\)" 1 font-lock-reference-face prepend)
275 ;; 278
279 ;; Fontify conditionals and includes.
280 ;; Note that plain `if' is an automake conditional, and not a bug.
281 '("^[ \t]*\\(-?include\\|if\\(n?eq\\|n?def\\)?\\)[ \t]+\\([^: \t\n#]+\\)"
282 (1 font-lock-warning-face) (3 font-lock-variable-name-face))
283
284 ;; Fontify endif and else.
285 '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?"
286 (1 font-lock-warning-face))
287
276 ;; Highlight lines that contain just whitespace. 288 ;; Highlight lines that contain just whitespace.
277 ;; They can cause trouble, especially if they start with a tab. 289 ;; They can cause trouble, especially if they start with a tab.
278 '("^[ \t]+$" . makefile-space-face) 290 '("^[ \t]+$" . makefile-space-face)
@@ -312,13 +324,13 @@ not be enclosed in { } or ( )."
312;;; ------------------------------------------------------------ 324;;; ------------------------------------------------------------
313 325
314(defcustom makefile-brave-make "make" 326(defcustom makefile-brave-make "make"
315 "How to invoke make, for `makefile-query-targets'. 327 "*How to invoke make, for `makefile-query-targets'.
316This should identify a `make' command that can handle the `-q' option." 328This should identify a `make' command that can handle the `-q' option."
317 :type 'string 329 :type 'string
318 :group 'makefile) 330 :group 'makefile)
319 331
320(defcustom makefile-query-one-target-method 'makefile-query-by-make-minus-q 332(defcustom makefile-query-one-target-method 'makefile-query-by-make-minus-q
321 "Function to call to determine whether a make target is up to date. 333 "*Function to call to determine whether a make target is up to date.
322The function must satisfy this calling convention: 334The function must satisfy this calling convention:
323 335
324* As its first argument, it must accept the name of the target to 336* As its first argument, it must accept the name of the target to
@@ -335,12 +347,18 @@ The function must satisfy this calling convention:
335 :group 'makefile) 347 :group 'makefile)
336 348
337(defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*" 349(defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*"
338 "Name of the Up-to-date overview buffer." 350 "*Name of the Up-to-date overview buffer."
339 :type 'string 351 :type 'string
340 :group 'makefile) 352 :group 'makefile)
341 353
342;;; --- end of up-to-date-overview configuration ------------------ 354;;; --- end of up-to-date-overview configuration ------------------
343 355
356(defvar makefile-mode-abbrev-table nil
357 "Abbrev table in use in Makefile buffers.")
358(if makefile-mode-abbrev-table
359 ()
360 (define-abbrev-table 'makefile-mode-abbrev-table ()))
361
344(defvar makefile-mode-map nil 362(defvar makefile-mode-map nil
345 "The keymap that is used in Makefile mode.") 363 "The keymap that is used in Makefile mode.")
346 364
@@ -574,6 +592,9 @@ makefile-special-targets-list:
574 (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) 592 (make-local-variable 'dabbrev-abbrev-skip-leading-regexp)
575 (setq dabbrev-abbrev-skip-leading-regexp "\\$") 593 (setq dabbrev-abbrev-skip-leading-regexp "\\$")
576 594
595 ;; Other abbrevs.
596 (setq local-abbrev-table makefile-mode-abbrev-table)
597
577 ;; Filling. 598 ;; Filling.
578 (make-local-variable 'fill-paragraph-function) 599 (make-local-variable 'fill-paragraph-function)
579 (setq fill-paragraph-function 'makefile-fill-paragraph) 600 (setq fill-paragraph-function 'makefile-fill-paragraph)