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
540a8bd2
Commit
540a8bd2
authored
Aug 15, 1997
by
Richard M. Stallman
Browse files
(widget-before-change): Obey `inhibit-read-only'.
parent
63abf612
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
lisp/wid-edit.el
lisp/wid-edit.el
+13
-12
No files found.
lisp/wid-edit.el
View file @
540a8bd2
...
...
@@ -1276,18 +1276,19 @@ Unlike (get-char-property POS 'field) this, works with empty fields too."
(
defun
widget-before-change
(
from
to
)
;; This is how, for example, a variable changes its state to `modified'.
;; when it is being edited.
(
let
((
from-field
(
widget-field-find
from
))
(
to-field
(
widget-field-find
to
)))
(
cond
((
not
(
eq
from-field
to-field
))
(
add-hook
'post-command-hook
'widget-add-change
nil
t
)
(
error
"Change should be restricted to a single field"
))
((
null
from-field
)
(
add-hook
'post-command-hook
'widget-add-change
nil
t
)
(
error
"Attempt to change text outside editable field"
))
(
widget-field-use-before-change
(
condition-case
nil
(
widget-apply
from-field
:notify
from-field
)
(
error
(
debug
"Before Change"
)))))))
(
unless
inhibit-read-only
(
let
((
from-field
(
widget-field-find
from
))
(
to-field
(
widget-field-find
to
)))
(
cond
((
not
(
eq
from-field
to-field
))
(
add-hook
'post-command-hook
'widget-add-change
nil
t
)
(
error
"Change should be restricted to a single field"
))
((
null
from-field
)
(
add-hook
'post-command-hook
'widget-add-change
nil
t
)
(
error
"Attempt to change text outside editable field"
))
(
widget-field-use-before-change
(
condition-case
nil
(
widget-apply
from-field
:notify
from-field
)
(
error
(
debug
"Before Change"
))))))))
(
defun
widget-add-change
()
(
make-local-hook
'post-command-hook
)
...
...
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