Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
025fddd4
Commit
025fddd4
authored
Jan 15, 2006
by
Luc Teirlinck
Browse files
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Do not ask for confirmation in single option buffers.
parent
b41e2e73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
21 deletions
+34
-21
lisp/cus-edit.el
lisp/cus-edit.el
+34
-21
No files found.
lisp/cus-edit.el
View file @
025fddd4
...
...
@@ -746,28 +746,35 @@ groups after non-groups, if nil do not order groups at all."
(
defun
Custom-set
()
"Set the current value of all edited settings in the buffer."
(
interactive
)
(
if
(
y-or-n-p
"Set all values according to this buffer? "
)
(
let
((
children
custom-options
))
(
let
((
children
custom-options
))
(
if
(
or
(
and
(
=
1
(
length
children
))
(
memq
(
widget-type
(
car
children
))
'
(
custom-variable
custom-face
)))
(
y-or-n-p
"Set all values according to this buffer? "
))
(
mapc
(
lambda
(
child
)
(
when
(
eq
(
widget-get
child
:custom-state
)
'modified
)
(
widget-apply
child
:custom-set
)))
children
)
)
(
message
"Aborted"
)))
children
)
(
message
"Aborted"
)))
)
(
defun
Custom-save
()
"Set all edited settings, then save all settings that have been set.
If a setting was edited and set before, this saves it.
If a setting was merely edited before, this sets it then saves it."
(
interactive
)
(
if
(
yes-or-no-p
"Save all settings in this buffer? "
)
(
let
((
children
custom-options
))
(
mapc
(
lambda
(
child
)
(
when
(
memq
(
widget-get
child
:custom-state
)
'
(
modified
set
changed
rogue
))
(
widget-apply
child
:custom-save
)))
children
)
(
custom-save-all
))
(
message
"Aborted"
)))
(
let
((
children
custom-options
))
(
if
(
or
(
and
(
=
1
(
length
children
))
(
memq
(
widget-type
(
car
children
))
'
(
custom-variable
custom-face
)))
(
yes-or-no-p
"Save all settings in this buffer? "
))
(
progn
(
mapc
(
lambda
(
child
)
(
when
(
memq
(
widget-get
child
:custom-state
)
'
(
modified
set
changed
rogue
))
(
widget-apply
child
:custom-save
)))
children
)
(
custom-save-all
))
(
message
"Aborted"
))))
(
defvar
custom-reset-menu
'
((
"Undo Edits"
.
Custom-reset-current
)
...
...
@@ -790,27 +797,33 @@ when the action is chosen.")
(
defun
Custom-reset-current
(
&rest
ignore
)
"Reset all edited settings in the buffer to show their current values."
(
interactive
)
(
if
(
y-or-n-p
"Reset all settings' buffer text to show current values? "
)
(
let
((
children
custom-options
))
(
let
((
children
custom-options
))
(
if
(
or
(
and
(
=
1
(
length
children
))
(
memq
(
widget-type
(
car
children
))
'
(
custom-variable
custom-face
)))
(
y-or-n-p
"Reset all settings' buffer text to show current values? "
))
(
mapc
(
lambda
(
widget
)
(
if
(
memq
(
widget-get
widget
:custom-state
)
'
(
modified
changed
))
(
widget-apply
widget
:custom-reset-current
)))
children
)
)
(
message
"Aborted"
)))
children
)
(
message
"Aborted"
)))
)
(
defun
Custom-reset-saved
(
&rest
ignore
)
"Reset all edited or set settings in the buffer to their saved value.
This also shows the saved values in the buffer."
(
interactive
)
(
if
(
y-or-n-p
"Reset all settings (current values and buffer text) to saved values? "
)
(
let
((
children
custom-options
))
(
let
((
children
custom-options
))
(
if
(
or
(
and
(
=
1
(
length
children
))
(
memq
(
widget-type
(
car
children
))
'
(
custom-variable
custom-face
)))
(
y-or-n-p
"Reset all settings (current values and buffer text) to saved values? "
))
(
mapc
(
lambda
(
widget
)
(
if
(
memq
(
widget-get
widget
:custom-state
)
'
(
modified
set
changed
rogue
))
(
widget-apply
widget
:custom-reset-saved
)))
children
)
)
(
message
"Aborted"
)))
children
)
(
message
"Aborted"
)))
)
(
defun
Custom-reset-standard
(
&rest
ignore
)
"Erase all customization (either current or saved) for the group members.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment