]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-edit.el
(eshell-windows-shell-file): Look for command.com, not command.exe.
[gnu-emacs] / lisp / cus-edit.el
index 6f5afa9bacd7d3e559eaf2cfa945976f5add130a..c0e54b4add303add1c833c63b4978608d3ec7332 100644 (file)
@@ -1,7 +1,7 @@
 ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
 ;;
 ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
 ;;
-;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-;;           Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: FSF
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: FSF
@@ -21,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 ;;
 
 ;;; Commentary:
 ;;
 (require 'cus-face)
 (require 'wid-edit)
 (eval-when-compile
 (require 'cus-face)
 (require 'wid-edit)
 (eval-when-compile
-  (defvar custom-versions-load-alist)) ; from cus-load
+  (defvar custom-versions-load-alist)  ; from cus-load
+  (defvar recentf-exclude))            ; from recentf.el
 
 (condition-case nil
     (require 'cus-load)
 
 (condition-case nil
     (require 'cus-load)
   :group 'development)
 
 (defgroup minibuffer nil
   :group 'development)
 
 (defgroup minibuffer nil
-  "Controling the behaviour of the minibuffer."
+  "Controling the behavior of the minibuffer."
   :link '(custom-manual "(emacs)Minibuffer")
   :group 'environment)
 
   :link '(custom-manual "(emacs)Minibuffer")
   :group 'environment)
 
@@ -1021,9 +1022,12 @@ then prompt for the MODE to customize."
 (defun customize-option (symbol)
   "Customize SYMBOL, which must be a user option variable."
   (interactive (custom-variable-prompt))
 (defun customize-option (symbol)
   "Customize SYMBOL, which must be a user option variable."
   (interactive (custom-variable-prompt))
-  (custom-buffer-create (list (list symbol 'custom-variable))
-                       (format "*Customize Option: %s*"
-                               (custom-unlispify-tag-name symbol))))
+  (let ((basevar (indirect-variable symbol)))
+    (custom-buffer-create (list (list basevar 'custom-variable))
+                         (format "*Customize Option: %s*"
+                                 (custom-unlispify-tag-name basevar)))
+    (unless (eq symbol basevar)
+      (message "`%s' is an alias for `%s'" symbol basevar))))
 
 ;;;###autoload
 (defalias 'customize-variable-other-window 'customize-option-other-window)
 
 ;;;###autoload
 (defalias 'customize-variable-other-window 'customize-option-other-window)
@@ -1033,9 +1037,12 @@ then prompt for the MODE to customize."
   "Customize SYMBOL, which must be a user option variable.
 Show the buffer in another window, but don't select it."
   (interactive (custom-variable-prompt))
   "Customize SYMBOL, which must be a user option variable.
 Show the buffer in another window, but don't select it."
   (interactive (custom-variable-prompt))
-  (custom-buffer-create-other-window
-   (list (list symbol 'custom-variable))
-   (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol))))
+  (let ((basevar (indirect-variable symbol)))
+    (custom-buffer-create-other-window
+     (list (list basevar 'custom-variable))
+     (format "*Customize Option: %s*" (custom-unlispify-tag-name basevar)))
+    (unless (eq symbol basevar)
+      (message "`%s' is an alias for `%s'" symbol basevar))))
 
 (defvar customize-changed-options-previous-release "20.2"
   "Version for `customize-changed-options' to refer back to by default.")
 
 (defvar customize-changed-options-previous-release "20.2"
   "Version for `customize-changed-options' to refer back to by default.")
@@ -1116,7 +1123,8 @@ version."
 ;;;###autoload
 (defun customize-face (&optional face)
   "Customize FACE, which should be a face name or nil.
 ;;;###autoload
 (defun customize-face (&optional face)
   "Customize FACE, which should be a face name or nil.
-If FACE is nil, customize all faces.
+If FACE is nil, customize all faces.  If FACE is actually a
+face-alias, customize the face it is aliased to.
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
@@ -1133,6 +1141,9 @@ suggest to customize that face, if it's customizable."
                                     face)
                             t nil)
                            "*Customize Faces*")
                                     face)
                             t nil)
                            "*Customize Faces*")
+    ;; If FACE is actually an alias, customize the face it is aliased to.
+    (if (get face 'face-alias)
+        (setq face (get face 'face-alias)))
     (unless (facep face)
       (error "Invalid face %S" face))
     (custom-buffer-create (list (list face 'custom-face))
     (unless (facep face)
       (error "Invalid face %S" face))
     (custom-buffer-create (list (list face 'custom-face))
@@ -1142,6 +1153,7 @@ suggest to customize that face, if it's customizable."
 ;;;###autoload
 (defun customize-face-other-window (&optional face)
   "Show customization buffer for face FACE in other window.
 ;;;###autoload
 (defun customize-face-other-window (&optional face)
   "Show customization buffer for face FACE in other window.
+If FACE is actually a face-alias, customize the face it is aliased to.
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
@@ -1159,6 +1171,8 @@ suggest to customize that face, if it's customizable."
                face)
        t nil)
        "*Customize Faces*")
                face)
        t nil)
        "*Customize Faces*")
+    (if (get face 'face-alias)
+        (setq face (get face 'face-alias)))
     (unless (facep face)
       (error "Invalid face %S" face))
     (custom-buffer-create-other-window
     (unless (facep face)
       (error "Invalid face %S" face))
     (custom-buffer-create-other-window
@@ -2187,7 +2201,7 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
      (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
     (((class color)
       (background light))
      (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
     (((class color)
       (background light))
-     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))    
+     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
     (t (:weight bold)))
   "Face used for unpushable variable tags."
   :group 'custom-faces)
     (t (:weight bold)))
   "Face used for unpushable variable tags."
   :group 'custom-faces)
@@ -3888,7 +3902,12 @@ if only the first line of the docstring is shown."))
   "Visit `custom-file' and delete all calls to SYMBOL from it.
 Leave point at the old location of the first such call,
 or (if there were none) at the end of the buffer."
   "Visit `custom-file' and delete all calls to SYMBOL from it.
 Leave point at the old location of the first such call,
 or (if there were none) at the end of the buffer."
-  (let ((default-major-mode 'emacs-lisp-mode))
+  (let ((default-major-mode 'emacs-lisp-mode)
+       (recentf-exclude (if recentf-mode
+                            (cons (concat "\\`"
+                                          (regexp-quote (custom-file))
+                                          "\\'")
+                                  recentf-exclude))))
     (set-buffer (find-file-noselect (custom-file))))
   (goto-char (point-min))
   ;; Skip all whitespace and comments.
     (set-buffer (find-file-noselect (custom-file))))
   (goto-char (point-min))
   ;; Skip all whitespace and comments.
@@ -4117,7 +4136,12 @@ or (if there were none) at the end of the buffer."
     (custom-save-variables)
     (custom-save-faces)
     (save-excursion
     (custom-save-variables)
     (custom-save-faces)
     (save-excursion
-      (let ((default-major-mode nil))
+      (let ((default-major-mode nil)
+           (recentf-exclude (if recentf-mode
+                                (cons (concat "\\`"
+                                              (regexp-quote (custom-file))
+                                              "\\'")
+                                      recentf-exclude))))
        (set-buffer (find-file-noselect (custom-file))))
       (let ((file-precious-flag t))
        (save-buffer)))))
        (set-buffer (find-file-noselect (custom-file))))
       (let ((file-precious-flag t))
        (save-buffer)))))
@@ -4215,6 +4239,7 @@ The format is suitable for use with `easy-menu-define'."
     (suppress-keymap map)
     (define-key map " " 'scroll-up)
     (define-key map "\177" 'scroll-down)
     (suppress-keymap map)
     (define-key map " " 'scroll-up)
     (define-key map "\177" 'scroll-down)
+    (define-key map "\C-c\C-c" 'Custom-set)
     (define-key map "\C-x\C-s" 'Custom-save)
     (define-key map "q" 'Custom-buffer-done)
     (define-key map "u" 'Custom-goto-parent)
     (define-key map "\C-x\C-s" 'Custom-save)
     (define-key map "q" 'Custom-buffer-done)
     (define-key map "u" 'Custom-goto-parent)
@@ -4244,7 +4269,7 @@ The format is suitable for use with `easy-menu-define'."
     ["Reset to Current" Custom-reset-current t]
     ["Reset to Saved" Custom-reset-saved t]
     ["Reset to Standard Settings" Custom-reset-standard t]
     ["Reset to Current" Custom-reset-current t]
     ["Reset to Saved" Custom-reset-saved t]
     ["Reset to Standard Settings" Custom-reset-standard t]
-    ["Info" (Info-goto-node "(emacs)Easy Customization") t]))
+    ["Info" (info "(emacs)Easy Customization") t]))
 
 (defun Custom-goto-parent ()
   "Go to the parent group listed at the top of this buffer.
 
 (defun Custom-goto-parent ()
   "Go to the parent group listed at the top of this buffer.