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: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Tue, 30 Aug 2005 06:35:09 -0400

Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.230 emacs/lisp/cus-edit.el:1.231
*** emacs/lisp/cus-edit.el:1.230        Fri Aug 12 11:17:57 2005
--- emacs/lisp/cus-edit.el      Tue Aug 30 10:35:09 2005
***************
*** 670,676 ****
    :type 'boolean
    :group 'custom-browse)
  
! (defcustom custom-buffer-sort-alphabetically nil
    "If non-nil, sort members of each customization group alphabetically."
    :type 'boolean
    :group 'custom-buffer)
--- 670,676 ----
    :type 'boolean
    :group 'custom-browse)
  
! (defcustom custom-buffer-sort-alphabetically t
    "If non-nil, sort members of each customization group alphabetically."
    :type 'boolean
    :group 'custom-buffer)
***************
*** 3836,3843 ****
            (setq magics (cdr magics)))))
        (widget-put widget :custom-state found)))
    (custom-magic-reset widget))
  
- ;;; The `custom-save-all' Function.
  ;;;###autoload
  (defcustom custom-file nil
    "File used for storing customization information.
--- 3836,3844 ----
            (setq magics (cdr magics)))))
        (widget-put widget :custom-state found)))
    (custom-magic-reset widget))
+ 
+ ;;; Reading and writing the custom file.
  
  ;;;###autoload
  (defcustom custom-file nil
    "File used for storing customization information.
***************
*** 3898,3914 ****
           (setq user-init-file default-init-file))
         user-init-file))))
  
  (defun custom-save-delete (symbol)
!   "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)
!       (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.
    (while (forward-comment 1))
--- 3899,3931 ----
           (setq user-init-file default-init-file))
         user-init-file))))
  
+ ;;;###autoload
+ (defun custom-save-all ()
+   "Save all customizations in `custom-file'."
+   (let* ((filename (custom-file))
+        (recentf-exclude (if recentf-mode
+                             (cons (concat "\\`"
+                                           (regexp-quote (custom-file))
+                                           "\\'")
+                                   recentf-exclude)))
+        (old-buffer (find-buffer-visiting filename)))
+     (with-current-buffer (or old-buffer (find-file-noselect filename))
+       (let ((inhibit-read-only t))
+       (custom-save-variables)
+       (custom-save-faces))
+       (let ((file-precious-flag t))
+       (save-buffer))
+       (unless old-buffer
+       (kill-buffer (current-buffer))))))
+ 
+ ;; Editing the custom file contents in a buffer.
+ 
  (defun custom-save-delete (symbol)
!   "Delete all calls to SYMBOL from the contents of the current buffer.
  Leave point at the old location of the first such call,
! or (if there were none) at the end of the buffer.
! 
! This function does not save the buffer."
    (goto-char (point-min))
    ;; Skip all whitespace and comments.
    (while (forward-comment 1))
***************
*** 4128,4151 ****
                  (put symbol 'customized-face-comment nil)))))
    ;; We really should update all custom buffers here.
    (custom-save-all))
! 
! ;;;###autoload
! (defun custom-save-all ()
!   "Save all customizations in `custom-file'."
!   (let ((inhibit-read-only t))
!     (custom-save-variables)
!     (custom-save-faces)
!     (save-excursion
!       (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)))))
! 
  ;;; The Customize Menu.
  
  ;;; Menu support
--- 4145,4151 ----
                  (put symbol 'customized-face-comment nil)))))
    ;; We really should update all custom buffers here.
    (custom-save-all))
! 
  ;;; The Customize Menu.
  
  ;;; Menu support




reply via email to

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