/[emacs]/emacs/lisp/cus-edit.el
ViewVC logotype

Diff of /emacs/lisp/cus-edit.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.181 by rms, Wed May 28 11:12:24 2003 UTC revision 1.182 by monnier, Sat May 31 15:23:00 2003 UTC
# Line 1  Line 1 
1  ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages  ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
2  ;;  ;;
3  ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.  ;; Copyright (C) 1996,97,1999,2000,01,02,2003  Free Software Foundation, Inc.
4  ;;  ;;
5  ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>  ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6  ;; Maintainer: FSF  ;; Maintainer: FSF
# Line 1189  links: groups have links to subgroups." Line 1189  links: groups have links to subgroups."
1189  ;; If we pass BUFFER to `bury-buffer', the buffer isn't removed from  ;; If we pass BUFFER to `bury-buffer', the buffer isn't removed from
1190  ;; the window.  ;; the window.
1191  (defun custom-bury-buffer (buffer)  (defun custom-bury-buffer (buffer)
1192    (bury-buffer))    (with-current-buffer buffer
1193        (bury-buffer)))
1194    
1195  (defcustom custom-buffer-done-function 'custom-bury-buffer  (defcustom custom-buffer-done-function 'custom-bury-buffer
1196    "*Function called to remove a Custom buffer when the user is done with it.    "*Function called to remove a Custom buffer when the user is done with it.
# Line 1205  Called with one argument, the buffer to Line 1206  Called with one argument, the buffer to
1206    :type 'integer    :type 'integer
1207    :group 'custom-buffer)    :group 'custom-buffer)
1208    
1209    (defun custom-get-fresh-buffer (name)
1210      "Get a fresh new buffer with name NAME.
1211    If the buffer already exist, clean it up to be like new."
1212      (let ((buf (get-buffer name)))
1213        (if (null buf)
1214            (get-buffer-create name)
1215          (with-current-buffer buf
1216            (kill-all-local-variables)
1217            (erase-buffer)
1218            (let ((ols (overlay-lists)))
1219              (dolist (ol (nconc (car ols) (cdr ols)))
1220                (delete-overlay ol)))
1221            buf))))
1222    
1223  ;;;###autoload  ;;;###autoload
1224  (defun custom-buffer-create (options &optional name description)  (defun custom-buffer-create (options &optional name description)
1225    "Create a buffer containing OPTIONS.    "Create a buffer containing OPTIONS.
# Line 1212  Optional NAME is the name of the buffer. Line 1227  Optional NAME is the name of the buffer.
1227  OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where  OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
1228  SYMBOL is a customization option, and WIDGET is a widget for editing  SYMBOL is a customization option, and WIDGET is a widget for editing
1229  that option."  that option."
1230    (unless name (setq name "*Customization*"))    (pop-to-buffer (custom-get-fresh-buffer (or name "*Customization*")))
   (kill-buffer (get-buffer-create name))  
   (pop-to-buffer (get-buffer-create name))  
1231    (custom-buffer-create-internal options description))    (custom-buffer-create-internal options description))
1232    
1233  ;;;###autoload  ;;;###autoload
# Line 1225  OPTIONS should be an alist of the form ( Line 1238  OPTIONS should be an alist of the form (
1238  SYMBOL is a customization option, and WIDGET is a widget for editing  SYMBOL is a customization option, and WIDGET is a widget for editing
1239  that option."  that option."
1240    (unless name (setq name "*Customization*"))    (unless name (setq name "*Customization*"))
   (kill-buffer (get-buffer-create name))  
1241    (let ((window (selected-window))    (let ((window (selected-window))
1242          (pop-up-windows t)          (pop-up-windows t)
1243          (special-display-buffer-names nil)          (special-display-buffer-names nil)
1244          (special-display-regexps nil)          (special-display-regexps nil)
1245          (same-window-buffer-names nil)          (same-window-buffer-names nil)
1246          (same-window-regexps nil))          (same-window-regexps nil))
1247      (pop-to-buffer (get-buffer-create name))      (pop-to-buffer (custom-get-fresh-buffer name))
1248      (custom-buffer-create-internal options description)      (custom-buffer-create-internal options description)
1249      (select-window window)))      (select-window window)))
1250    
# Line 1392  Un-customize all values in this buffer. Line 1404  Un-customize all values in this buffer.
1404    (unless group    (unless group
1405      (setq group 'emacs))      (setq group 'emacs))
1406    (let ((name "*Customize Browser*"))    (let ((name "*Customize Browser*"))
1407      (kill-buffer (get-buffer-create name))      (pop-to-buffer (custom-get-fresh-buffer name)))
     (pop-to-buffer (get-buffer-create name)))  
1408    (custom-mode)    (custom-mode)
1409    (widget-insert "\    (widget-insert "\
1410  Square brackets show active fields; type RET or click mouse-1  Square brackets show active fields; type RET or click mouse-1
# Line 2440  The value that was current before this o Line 2451  The value that was current before this o
2451  becomes the backup value, so you can get it again."  becomes the backup value, so you can get it again."
2452    (let* ((symbol (widget-value widget))    (let* ((symbol (widget-value widget))
2453           (set (or (get symbol 'custom-set) 'set-default))           (set (or (get symbol 'custom-set) 'set-default))
          (comment-widget (widget-get widget :comment-widget))  
2454           (value (get symbol 'saved-value))           (value (get symbol 'saved-value))
2455           (comment (get symbol 'saved-variable-comment)))           (comment (get symbol 'saved-variable-comment)))
2456      (cond ((or value comment)      (cond ((or value comment)
# Line 2464  restoring it to the state of a variable Line 2474  restoring it to the state of a variable
2474  The value that was current before this operation  The value that was current before this operation
2475  becomes the backup value, so you can get it again."  becomes the backup value, so you can get it again."
2476    (let* ((symbol (widget-value widget))    (let* ((symbol (widget-value widget))
2477           (set (or (get symbol 'custom-set) 'set-default))           (set (or (get symbol 'custom-set) 'set-default)))
          (comment-widget (widget-get widget :comment-widget)))  
2478      (if (get symbol 'standard-value)      (if (get symbol 'standard-value)
2479          (progn          (progn
2480            (custom-variable-backup-value widget)            (custom-variable-backup-value widget)
# Line 2586  Also change :reverse-video to :inverse-v Line 2595  Also change :reverse-video to :inverse-v
2595    (unless (widget-get widget :inactive)    (unless (widget-get widget :inactive)
2596      (let ((tag (custom-face-edit-attribute-tag widget))      (let ((tag (custom-face-edit-attribute-tag widget))
2597            (from (copy-marker (widget-get widget :from)))            (from (copy-marker (widget-get widget :from)))
           (to (widget-get widget :to))  
2598            (value (widget-value widget))            (value (widget-value widget))
2599            (inhibit-read-only t)            (inhibit-read-only t)
2600            (inhibit-modification-hooks t))            (inhibit-modification-hooks t))
# Line 3727  or (if there were none) at the end of th Line 3735  or (if there were none) at the end of th
3735                              (and (not (boundp symbol))                              (and (not (boundp symbol))
3736                                   (not (eq (get symbol 'force-value)                                   (not (eq (get symbol 'force-value)
3737                                            'rogue))))))                                            'rogue))))))
3738                (comment (get symbol 'saved-variable-comment))                (comment (get symbol 'saved-variable-comment)))
               sep)  
3739            ;; Check `requests'.            ;; Check `requests'.
3740            (dolist (request requests)            (dolist (request requests)
3741              (when (and (symbolp request) (not (featurep request)))              (when (and (symbolp request) (not (featurep request)))

Legend:
Removed from v.1.181  
changed lines
  Added in v.1.182

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26