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
dae157b7
Commit
dae157b7
authored
Sep 21, 2007
by
Stefan Monnier
Browse files
(define-minor-mode): Fix staging brain damage.
parent
e243eb1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
lisp/ChangeLog
lisp/ChangeLog
+4
-0
lisp/emacs-lisp/easy-mmode.el
lisp/emacs-lisp/easy-mmode.el
+27
-25
No files found.
lisp/ChangeLog
View file @
dae157b7
2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/easy-mmode.el (define-minor-mode): Fix staging brain damage.
2007-09-21 Kevin Ryde <user42@zip.com.au>
* international/mule.el (sgml-html-meta-auto-coding-function):
lisp/emacs-lisp/easy-mmode.el
View file @
dae157b7
...
...
@@ -139,8 +139,8 @@ For example, you could write
(
setq
body
(
list*
lighter
keymap
body
)
lighter
nil
keymap
nil
))
((
keywordp
keymap
)
(
push
keymap
body
)
(
setq
keymap
nil
)))
(
let*
((
last-message
(
curren
t-message
))
(
mode-name
(
symbol-name
mode
))
(
let*
((
last-message
(
make-symbol
"las
t-message
"
))
(
mode-name
(
symbol-name
mode
))
(
pretty-name
(
easy-mmode-pretty-mode-name
mode
lighter
))
(
globalp
nil
)
(
set
nil
)
...
...
@@ -222,28 +222,30 @@ With zero or negative ARG turn mode off.
;; Use `toggle' rather than (if ,mode 0 1) so that using
;; repeat-command still does the toggling correctly.
(
interactive
(
list
(
or
current-prefix-arg
'toggle
)))
(
setq
,
mode
(
cond
((
eq
arg
'toggle
)
(
not
,
mode
))
(
arg
(
>
(
prefix-numeric-value
arg
)
0
))
(
t
(
if
(
null
,
mode
)
t
(
message
"Toggling %s off; better pass an explicit argument."
',mode
)
nil
))))
,@
body
;; The on/off hooks are here for backward compatibility only.
(
run-hooks
',hook
(
if
,
mode
',hook-on
',hook-off
))
(
if
(
called-interactively-p
)
(
progn
,
(
if
globalp
`
(
customize-mark-as-set
',mode
))
;; Avoid overwriting a message shown by the body,
;; but do overwrite previous messages.
(
unless
,
(
and
(
current-message
)
(
not
(
equal
last-message
(
current-message
))))
(
message
,
(
format
"%s %%sabled"
pretty-name
)
(
if
,
mode
"en"
"dis"
)))))
(
let
((
,
last-message
(
current-message
)))
(
setq
,
mode
(
cond
((
eq
arg
'toggle
)
(
not
,
mode
))
(
arg
(
>
(
prefix-numeric-value
arg
)
0
))
(
t
(
if
(
null
,
mode
)
t
(
message
"Toggling %s off; better pass an explicit argument."
',mode
)
nil
))))
,@
body
;; The on/off hooks are here for backward compatibility only.
(
run-hooks
',hook
(
if
,
mode
',hook-on
',hook-off
))
(
if
(
called-interactively-p
)
(
progn
,
(
if
globalp
`
(
customize-mark-as-set
',mode
))
;; Avoid overwriting a message shown by the body,
;; but do overwrite previous messages.
(
unless
(
and
(
current-message
)
(
not
(
equal
,
last-message
(
current-message
))))
(
message
,
(
format
"%s %%sabled"
pretty-name
)
(
if
,
mode
"en"
"dis"
))))))
(
force-mode-line-update
)
;; Return the new setting.
,
mode
)
...
...
@@ -539,5 +541,5 @@ found, do `widen' first and then call NARROWFUN with no args after moving."
(
provide
'easy-mmode
)
;;
;
arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a
;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a
;;; easy-mmode.el ends here
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