emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/cus-edit.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Sat, 31 May 2003 11:23:01 -0400

Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.181 emacs/lisp/cus-edit.el:1.182
*** emacs/lisp/cus-edit.el:1.181        Wed May 28 07:12:24 2003
--- emacs/lisp/cus-edit.el      Sat May 31 11:23:00 2003
***************
*** 1,6 ****
  ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
  ;;
! ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software 
Foundation, Inc.
  ;;
  ;; Author: Per Abrahamsen <address@hidden>
  ;; Maintainer: FSF
--- 1,6 ----
  ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
  ;;
! ;; Copyright (C) 1996,97,1999,2000,01,02,2003  Free Software Foundation, Inc.
  ;;
  ;; Author: Per Abrahamsen <address@hidden>
  ;; Maintainer: FSF
***************
*** 1189,1195 ****
  ;; If we pass BUFFER to `bury-buffer', the buffer isn't removed from
  ;; the window.
  (defun custom-bury-buffer (buffer)
!   (bury-buffer))
  
  (defcustom custom-buffer-done-function 'custom-bury-buffer
    "*Function called to remove a Custom buffer when the user is done with it.
--- 1189,1196 ----
  ;; If we pass BUFFER to `bury-buffer', the buffer isn't removed from
  ;; the window.
  (defun custom-bury-buffer (buffer)
!   (with-current-buffer buffer
!     (bury-buffer)))
  
  (defcustom custom-buffer-done-function 'custom-bury-buffer
    "*Function called to remove a Custom buffer when the user is done with it.
***************
*** 1205,1210 ****
--- 1206,1225 ----
    :type 'integer
    :group 'custom-buffer)
  
+ (defun custom-get-fresh-buffer (name)
+   "Get a fresh new buffer with name NAME.
+ If the buffer already exist, clean it up to be like new."
+   (let ((buf (get-buffer name)))
+     (if (null buf)
+       (get-buffer-create name)
+       (with-current-buffer buf
+       (kill-all-local-variables)
+       (erase-buffer)
+       (let ((ols (overlay-lists)))
+         (dolist (ol (nconc (car ols) (cdr ols)))
+           (delete-overlay ol)))
+       buf))))
+ 
  ;;;###autoload
  (defun custom-buffer-create (options &optional name description)
    "Create a buffer containing OPTIONS.
***************
*** 1212,1220 ****
  OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
  SYMBOL is a customization option, and WIDGET is a widget for editing
  that option."
!   (unless name (setq name "*Customization*"))
!   (kill-buffer (get-buffer-create name))
!   (pop-to-buffer (get-buffer-create name))
    (custom-buffer-create-internal options description))
  
  ;;;###autoload
--- 1227,1233 ----
  OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
  SYMBOL is a customization option, and WIDGET is a widget for editing
  that option."
!   (pop-to-buffer (custom-get-fresh-buffer (or name "*Customization*")))
    (custom-buffer-create-internal options description))
  
  ;;;###autoload
***************
*** 1225,1238 ****
  SYMBOL is a customization option, and WIDGET is a widget for editing
  that option."
    (unless name (setq name "*Customization*"))
-   (kill-buffer (get-buffer-create name))
    (let ((window (selected-window))
        (pop-up-windows t)
        (special-display-buffer-names nil)
        (special-display-regexps nil)
        (same-window-buffer-names nil)
        (same-window-regexps nil))
!     (pop-to-buffer (get-buffer-create name))
      (custom-buffer-create-internal options description)
      (select-window window)))
  
--- 1238,1250 ----
  SYMBOL is a customization option, and WIDGET is a widget for editing
  that option."
    (unless name (setq name "*Customization*"))
    (let ((window (selected-window))
        (pop-up-windows t)
        (special-display-buffer-names nil)
        (special-display-regexps nil)
        (same-window-buffer-names nil)
        (same-window-regexps nil))
!     (pop-to-buffer (custom-get-fresh-buffer name))
      (custom-buffer-create-internal options description)
      (select-window window)))
  
***************
*** 1392,1399 ****
    (unless group
      (setq group 'emacs))
    (let ((name "*Customize Browser*"))
!     (kill-buffer (get-buffer-create name))
!     (pop-to-buffer (get-buffer-create name)))
    (custom-mode)
    (widget-insert "\
  Square brackets show active fields; type RET or click mouse-1
--- 1404,1410 ----
    (unless group
      (setq group 'emacs))
    (let ((name "*Customize Browser*"))
!     (pop-to-buffer (custom-get-fresh-buffer name)))
    (custom-mode)
    (widget-insert "\
  Square brackets show active fields; type RET or click mouse-1
***************
*** 2440,2446 ****
  becomes the backup value, so you can get it again."
    (let* ((symbol (widget-value widget))
         (set (or (get symbol 'custom-set) 'set-default))
-        (comment-widget (widget-get widget :comment-widget))
         (value (get symbol 'saved-value))
         (comment (get symbol 'saved-variable-comment)))
      (cond ((or value comment)
--- 2451,2456 ----
***************
*** 2464,2471 ****
  The value that was current before this operation
  becomes the backup value, so you can get it again."
    (let* ((symbol (widget-value widget))
!        (set (or (get symbol 'custom-set) 'set-default))
!        (comment-widget (widget-get widget :comment-widget)))
      (if (get symbol 'standard-value)
        (progn
          (custom-variable-backup-value widget)
--- 2474,2480 ----
  The value that was current before this operation
  becomes the backup value, so you can get it again."
    (let* ((symbol (widget-value widget))
!        (set (or (get symbol 'custom-set) 'set-default)))
      (if (get symbol 'standard-value)
        (progn
          (custom-variable-backup-value widget)
***************
*** 2586,2592 ****
    (unless (widget-get widget :inactive)
      (let ((tag (custom-face-edit-attribute-tag widget))
          (from (copy-marker (widget-get widget :from)))
-         (to (widget-get widget :to))
          (value (widget-value widget))
          (inhibit-read-only t)
          (inhibit-modification-hooks t))
--- 2595,2600 ----
***************
*** 3727,3734 ****
                            (and (not (boundp symbol))
                                 (not (eq (get symbol 'force-value)
                                          'rogue))))))
!             (comment (get symbol 'saved-variable-comment))
!             sep)
          ;; Check `requests'.
          (dolist (request requests)
            (when (and (symbolp request) (not (featurep request)))
--- 3735,3741 ----
                            (and (not (boundp symbol))
                                 (not (eq (get symbol 'force-value)
                                          'rogue))))))
!             (comment (get symbol 'saved-variable-comment)))
          ;; Check `requests'.
          (dolist (request requests)
            (when (and (symbolp request) (not (featurep request)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]