diff options
author | Miles Bader <miles@gnu.org> | 2007-12-06 09:51:45 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-12-06 09:51:45 +0000 |
commit | 0bd508417142ff377f34aec8dcec9438d9175c2c (patch) | |
tree | 4d60fe09e5cebf7d79766b11e9cda8cc1c9dbb9b /lisp/cus-edit.el | |
parent | 98fe991da804a42f53f6a5e84cd5eab18a82e181 (diff) | |
parent | 9fb1ba8090da3528de56158a79bd3527d31c7f2f (diff) | |
download | emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.tar.gz emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.tar.bz2 emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.zip |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 5e398d46ccf..b9e462ec05f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -491,6 +491,14 @@ map) "Local keymap for links in `custom-mode'.") +(defvar custom-field-keymap + (let ((map (copy-keymap widget-field-keymap))) + (define-key map "\C-c\C-c" 'Custom-set) + (define-key map "\C-x\C-s" 'Custom-save) + map) + "Keymap used inside editable fields in customization buffers.") + +(widget-put (get 'editable-field 'widget-type) :keymap custom-field-keymap) ;;; Utilities. @@ -4126,6 +4134,9 @@ if only the first line of the docstring is shown.")) (setq user-init-file default-init-file)) user-init-file)))) +;; If recentf-mode is non-nil, this is defined. +(declare-function recentf-expand-file-name "recentf" (name)) + ;;;###autoload (defun custom-save-all () "Save all customizations in `custom-file'." @@ -4435,7 +4446,7 @@ The format is suitable for use with `easy-menu-define'." ;;; Toolbar and menubar support (easy-menu-define - Custom-mode-menu custom-mode-map + Custom-mode-menu (list custom-mode-map custom-field-keymap) "Menu used in customization buffers." (nconc (list "Custom" (customize-menu-create 'customize)) @@ -4473,15 +4484,6 @@ The format is suitable for use with `easy-menu-define'." (widget-apply-action button event) (error "You can't edit this part of the Custom buffer")))) -(defvar custom-field-keymap - (let ((map (copy-keymap widget-field-keymap))) - (define-key map "\C-c\C-c" 'Custom-set) - (define-key map "\C-x\C-s" 'Custom-save) - map) - "Keymap used inside editable fields in customization buffers.") - -(widget-put (get 'editable-field 'widget-type) :keymap custom-field-keymap) - (defun Custom-goto-parent () "Go to the parent group listed at the top of this buffer. If several parents are listed, go to the first of them." @@ -4502,7 +4504,7 @@ If several parents are listed, go to the first of them." (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: @@ -4524,9 +4526,6 @@ Erase customizations; set options 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) @@ -4536,6 +4535,7 @@ if that value is non-nil." (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 @@ -4553,8 +4553,7 @@ if that value is non-nil." (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) |