From xemacs-m  Wed Apr  9 17:11:58 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id RAA07333
	for <xemacs-beta@xemacs.org>; Wed, 9 Apr 1997 17:11:57 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id AAA05133; Thu, 10 Apr 1997 00:11:55 +0200 (MET DST)
Sender: hniksic@public.srce.hr
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: make-mode.el is customized
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nA
        EL1M(".[qvI#a2E6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/X
        vhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 10 Apr 1997 00:11:54 +0200
Message-ID: <kig7mibdexh.fsf@jagor.srce.hr>
Lines: 285
X-Mailer: Gnus v5.4.42/XEmacs 19.15

Even if you don't test the other changes, please try testing the
defcustom for `makefile-space-face' (you can evaluate it independently
and use `M-x customize-face').  This is my first try at `defface'.

In fact, I'd like you to test it on monochrome and grayscale devices.

--- make-mode.el.orig	Wed Apr  9 23:30:25 1997
+++ make-mode.el	Thu Apr 10 00:07:11 1997
@@ -93,6 +93,12 @@
 
 (provide 'makefile)
 
+(defgroup makefile-mode nil
+  "Makefile mode customizations"
+  :group 'tools
+  :prefix "makefile-")
+
+
 ;; Sadly we need this for a macro.
 (eval-when-compile
   (require 'imenu))
@@ -101,73 +107,106 @@
 ;;; Configurable stuff
 ;;; ------------------------------------------------------------
 
-(defvar makefile-browser-buffer-name "*Macros and Targets*"
-  "Name of the macro- and target browser buffer.")
+(defcustom makefile-browser-buffer-name "*Macros and Targets*"
+  "Name of the macro- and target browser buffer."
+  :type 'string
+  :group 'makefile-mode)
 
-(defvar makefile-target-colon ":"
+(defcustom makefile-target-colon ":"
   "String to append to all target names inserted by `makefile-insert-target'.
-\":\" or \"::\" are common values.")
+\":\" or \"::\" are common values."
+  :type 'string
+  :group 'makefile-mode)
 
-(defvar makefile-macro-assign " = "
+(defcustom makefile-macro-assign " = "
   "String to append to all macro names inserted by `makefile-insert-macro'.
 The normal value should be \" = \", since this is what
 standard make expects. However, newer makes such as dmake
 allow a larger variety of different macro assignments, so you
-might prefer to use \" += \" or \" := \" .")
+might prefer to use \" += \" or \" := \" ."
+  :type 'string
+  :group 'makefile-mode)
 
-(defvar makefile-electric-keys nil
+(defcustom makefile-electric-keys nil
   "If non-nil, install electric keybindings.
-Default is nil.")
+Default is nil."
+  :type 'boolean
+  :group 'makefile-mode)
 
-(defvar makefile-use-curly-braces-for-macros-p nil
+(defcustom makefile-use-curly-braces-for-macros-p nil
   "Controls the style of generated macro references.
 t (actually non-nil) means macro references should use curly braces,
 like `${this}'.
-nil means use parentheses, like `$(this)'.")
+nil means use parentheses, like `$(this)'."
+  :type 'boolean
+  :group 'makefile-mode)
 
-(defvar makefile-tab-after-target-colon t
+(defcustom makefile-tab-after-target-colon t
   "If non-nil, insert a TAB after a target colon.
 Otherwise, a space is inserted.
-The default is t.")
-
-(defvar makefile-browser-leftmost-column 10
-  "Number of blanks to the left of the browser selection mark.")
+The default is t."
+  :type 'boolean
+  :group 'makefile-mode)
+
+(defcustom makefile-browser-leftmost-column 10
+  "Number of blanks to the left of the browser selection mark."
+  :type 'integer
+  :group 'makefile-mode)
 
-(defvar makefile-browser-cursor-column 10
+(defcustom makefile-browser-cursor-column 10
   "Column in which the cursor is positioned when it moves
-up or down in the browser.")
-
-(defvar makefile-backslash-column 48
-  "*Column in which `makefile-backslash-region' inserts backslashes.")
-
-(defvar makefile-browser-selected-mark "+  "
-  "String used to mark selected entries in the browser.")
+up or down in the browser."
+  :type 'integer
+  :group 'makefile-mode)
+
+(defcustom makefile-backslash-column 48
+  "*Column in which `makefile-backslash-region' inserts backslashes."
+  :type 'integer
+  :group 'makefile-mode)
+
+(defcustom makefile-browser-selected-mark "+  "
+  "String used to mark selected entries in the browser."
+  :type 'string
+  :group 'makefile-mode)
+
+(defcustom makefile-browser-unselected-mark "   "
+  "String used to mark unselected entries in the browser."
+  :type 'string
+  :group 'makefile-mode)
+
+(defcustom makefile-browser-auto-advance-after-selection-p t
+  "If non-nil, cursor will move after item is selected in browser."
+  :type 'boolean
+  :group 'makefile-mode)
 
-(defvar makefile-browser-unselected-mark "   "
-  "String used to mark unselected entries in the browser.")
-
-(defvar makefile-browser-auto-advance-after-selection-p t
-  "If non-nil, cursor will move after item is selected in browser.")
-
-(defvar makefile-pickup-everything-picks-up-filenames-p nil
+(defcustom makefile-pickup-everything-picks-up-filenames-p nil
   "If non-nil, `makefile-pickup-everything' picks up filenames as targets.
 \(i.e. it calls `makefile-find-filenames-as-targets').
-Otherwise filenames are omitted.")
+Otherwise filenames are omitted."
+  :type 'boolean
+  :group 'makefile-mode)
 
-(defvar makefile-cleanup-continuations-p t
+(defcustom makefile-cleanup-continuations-p t
   "If non-nil, automatically clean up continuation lines when saving.
 A line is cleaned up by removing all whitespace following a trailing
 backslash.  This is done silently.
 IMPORTANT: Please note that enabling this option causes makefile-mode
-to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \'it seems necessary\'.")
+to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \'it seems necessary\'."
+  :type 'boolean
+  :group 'makefile-mode)
 
 ;;; those suspicious line warnings are really annoying and
 ;;; seem to be generated for every makefile I've ever seen.
 ;;; add a simple mechanism to disable them.  -gk
-(defvar makefile-warn-suspicious-lines-p t
-  "In non-nil, warn about suspicious lines when saving the makefile")
-
-(defvar makefile-browser-hook '())
+(defcustom makefile-warn-suspicious-lines-p t
+  "In non-nil, warn about suspicious lines when saving the makefile"
+  :type 'boolean
+  :group 'makefile-mode)
+
+(defcustom makefile-browser-hook '()
+  "The hook to run when entering makefile browser."
+  :type 'hook
+  :group 'makefile-mode)
 
 ;;
 ;; Special targets for DMake, Sun's make ...
@@ -213,8 +252,23 @@
 ;####
 ;(add-to-list 'facemenu-unlisted-faces 'makefile-space-face)
 ;  Bogus FSFmacs crap.
-(defvar makefile-space-face 'makefile-space-face
-  "Face to use for highlighting leading spaces in Font-Lock mode.")
+(defface makefile-space-face
+  '((((class color))
+     (:background "hotpink"))		; uhm
+    (((class grayscale)
+      (background light))
+     (:background "black"))
+    (((class grayscale)
+      (background black))
+     (:background "white"))
+    (((class mono)
+      (background light))
+     (:background "white"))
+    (((class mono)
+      (background dark))
+     (:background "black")))
+  "Face to use for highlighting leading spaces in Font-Lock mode."
+  :group 'makefile-mode)
 
 ;Older version of same.
 ;(defconst makefile-font-lock-keywords (purecopy
@@ -248,15 +302,15 @@
 
    ;; Highlight lines that contain just whitespace.
    ;; They can cause trouble, especially if they start with a tab.
-   '("^[ \t]+$" . makefile-space-face)
+   '("^[ \t]+$" . 'makefile-space-face)
 
    ;; Highlight shell comments that Make treats as commands,
    ;; since these can fool people.
-   '("^\t+#" 0 makefile-space-face t)
+   '("^\t+#" 0 'makefile-space-face t)
 
    ;; Highlight spaces that precede tabs.
    ;; They can make a tab fail to be effective.
-   '("^\\( +\\)\t" 1 makefile-space-face)))
+   '("^\\( +\\)\t" 1 'makefile-space-face)))
   "Additional expressions to highlight in makefiles")
 
 (put 'makefile-mode 'font-lock-defaults '(makefile-font-lock-keywords))
@@ -281,10 +335,12 @@
 ;;; of `makefile-query-by-make-minus-q' .
 ;;; ------------------------------------------------------------
 
-(defvar makefile-brave-make "make"
-  "A make that can handle the `-q' option.")
+(defcustom makefile-brave-make "make"
+  "A make that can handle the `-q' option."
+  :type 'string
+  :group 'makefile-mode)
 
-(defvar makefile-query-one-target-method 'makefile-query-by-make-minus-q
+(defcustom makefile-query-one-target-method 'makefile-query-by-make-minus-q
   "Function to call to determine whether a make target is up to date.
 The function must satisfy this calling convention:
 
@@ -297,10 +353,14 @@
 
 * It must return the integer value 0 (zero) if the given target
   should be considered up-to-date in the context of the given
-  makefile, any nonzero integer value otherwise.")
-
-(defvar makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*"
-  "Name of the Up-to-date overview buffer.")
+  makefile, any nonzero integer value otherwise."
+  :type 'function
+  :group 'makefile-mode)
+
+(defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*"
+  "Name of the Up-to-date overview buffer."
+  :type 'string
+  :group 'makefile-mode)
 
 ;;; --- end of up-to-date-overview configuration ------------------
 
@@ -522,8 +582,6 @@
   (make-local-variable 'makefile-need-macro-pickup)
 
   ;; Font lock.
-  (if (fboundp 'make-face)
-      (makefile-define-space-face))
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults '(makefile-font-lock-keywords))
 
@@ -1427,25 +1485,5 @@
 		     alist))))
     (imenu-progress-message stupid 100)
     (nreverse alist)))
-
-(defun makefile-define-space-face ()
-  (make-face 'makefile-space-face)
-  ;; XEmacs change
-  (let* ((light-bg t)) ; ####
-    (set-face-background 'makefile-space-face
-			 (if light-bg "black" "white")
-			 nil
-			 '(mono x)
-			 'append)
-    (set-face-background 'makefile-space-face
-			 (if light-bg "black" "white")
-			 nil
-			 '(grayscale x)
-			 'append)
-    (set-face-background 'makefile-space-face
-			 "hotpink"
-			 nil
-			 '(color x)
-			 'append)))
 
 ;;; make-mode.el ends here

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Good pings come in small packets.

