changeset 86334:005ad07af670

(custom-mode): Define with `define-derived-mode'. Set `show-trailing-whitespace' to nil.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 22 Nov 2007 16:49:47 +0000
parents 3360920fa85b
children eaf0c8e1e9aa
files lisp/cus-edit.el
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Thu Nov 22 16:16:09 2007 +0000
+++ b/lisp/cus-edit.el	Thu Nov 22 16:49:47 2007 +0000
@@ -4504,7 +4504,7 @@
   (if (eq (widget-get (widget-get widget :parent) :custom-state) 'modified)
       (message "To install your edits, invoke [State] and choose the Set operation")))
 
-(defun custom-mode ()
+(define-derived-mode custom-mode nil "Custom"
   "Major mode for editing customization buffers.
 
 The following commands are available:
@@ -4526,9 +4526,6 @@
 
 Entry to this mode calls the value of `custom-mode-hook'
 if that value is non-nil."
-  (kill-all-local-variables)
-  (setq major-mode 'custom-mode
-	mode-name "Custom")
   (use-local-map custom-mode-map)
   (easy-menu-add Custom-mode-menu)
   (set (make-local-variable 'tool-bar-map) custom-tool-bar-map)
@@ -4538,6 +4535,7 @@
   (setq widget-documentation-face 'custom-documentation)
   (make-local-variable 'widget-button-face)
   (setq widget-button-face custom-button)
+  (setq show-trailing-whitespace nil)
 
   ;; We need this because of the "More" button on docstrings.
   ;; Otherwise clicking on "More" can push point offscreen, which
@@ -4555,8 +4553,7 @@
     (set (make-local-variable 'widget-push-button-suffix) "")
     (set (make-local-variable 'widget-link-prefix) "")
     (set (make-local-variable 'widget-link-suffix) ""))
-  (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t)
-  (run-mode-hooks 'custom-mode-hook))
+  (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t))
 
 (put 'custom-mode 'mode-class 'special)