]> git.rkrishnan.org Git - .emacs.d.git/blob - emacs/nxhtml/util/custsets.el
remove toolbar and menubar
[.emacs.d.git] / emacs / nxhtml / util / custsets.el
1 ;;; custsets.el --- Sets of named customizations
2 ;;
3 ;; Author: Lennart Borgman (lennart O borgman A gmail O com)
4 ;; Created: 2008-03-25T00:17:06+0100 Mon
5 ;; Version:
6 ;; Last-Updated:
7 ;; URL:
8 ;; Keywords:
9 ;; Compatibility:
10 ;;
11 ;; Features that might be required by this library:
12 ;;
13 ;;   None
14 ;;
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16 ;;
17 ;;; Commentary:
18 ;;
19 ;; After an idea expressed by among other Stephen Turnbull on the
20 ;; emacs devel list.
21 ;;
22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23 ;;
24 ;;; Change log:
25 ;;
26 ;;
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 ;;
29 ;; This program is free software; you can redistribute it and/or
30 ;; modify it under the terms of the GNU General Public License as
31 ;; published by the Free Software Foundation; either version 2, or
32 ;; (at your option) any later version.
33 ;;
34 ;; This program is distributed in the hope that it will be useful,
35 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
37 ;; General Public License for more details.
38 ;;
39 ;; You should have received a copy of the GNU General Public License
40 ;; along with this program; see the file COPYING.  If not, write to
41 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
42 ;; Floor, Boston, MA 02110-1301, USA.
43 ;;
44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
45 ;;
46 ;;; Code:
47
48 (defcustom custsets-sets
49   '(
50     ("Windows"
51      (cua-mode t)
52      )
53     )
54   "Sets of customizations."
55   :group 'custsets)
56
57 (defun custsets-turn-on (set-name)
58   (interactive "sCustomization set: ")
59   (let ((set (assoc-string set-name custsets-sets t)))
60     (unless set
61       (error "Can't find customization set %s" set-name))
62     (dolist (opt-rec (cdr set))
63       (let* ((opt (car opt-rec))
64              (val (cdr opt-rec))
65              (saved-opt (get opt 'saved-value))
66              (saved-val saved-opt) ;; fix-me
67              (ask (if saved-opt
68                       (format "You have currently customized %s to %s. Change this to %s? "
69                               opt saved-opt val)
70                     (format "Customize %s to %s? " opt val)))
71              )
72         (when (y-or-n-p ask)
73           (customize-set-variable opt val)
74           (customize-set-value opt val)
75           (customize-mark-to-save opt))
76         )
77       )
78     (custom-save-all)))
79
80
81 (provide 'custsets)
82 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83 ;;; custsets.el ends here