diff lisp/progmodes/compile.el @ 18987:528cead9a6c3

(compile-command): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Jul 1997 19:02:00 +0000
parents d2c26a873eb4
children 1606d5205bbc
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Fri Jul 25 18:12:53 1997 +0000
+++ b/lisp/progmodes/compile.el	Fri Jul 25 19:02:00 1997 +0000
@@ -423,11 +423,13 @@
 You might also use mode hooks to specify it in certain modes, like this:
 
     (setq c-mode-hook
-      '(lambda () (or (file-exists-p \"makefile\") (file-exists-p \"Makefile\")
-		      (progn (make-local-variable 'compile-command)
-			     (setq compile-command
-				    (concat \"make -k \"
-					    buffer-file-name))))))"
+      (lambda ()
+	(unless (or (file-exists-p \"makefile\")
+		    (file-exists-p \"Makefile\"))
+	  (make-local-variable 'compile-command)
+	  (setq compile-command
+		(concat \"make -k \"
+			(file-name-sans-extension buffer-file-name))))))"
   :type 'string
   :group 'compilation)