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
24f3d7b9
Commit
24f3d7b9
authored
Nov 20, 2011
by
Stefan Monnier
Browse files
* lisp/electric.el (electric-indent-mode): Fix last change (too optimistic).
parent
a5bb9bd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
lisp/ChangeLog
lisp/ChangeLog
+2
-0
lisp/electric.el
lisp/electric.el
+17
-9
No files found.
lisp/ChangeLog
View file @
24f3d7b9
2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
* electric.el (electric-indent-mode): Fix last change (too optimistic).
* emacs-lisp/bytecomp.el: Silence obsolete warnings more reliably.
(byte-compile-global-not-obsolete-vars): New var.
(byte-compile-check-variable, byte-compile-make-obsolete-variable):
...
...
lisp/electric.el
View file @
24f3d7b9
...
...
@@ -260,15 +260,23 @@ reindentation is triggered whenever you insert a character listed
in `electric-indent-chars'."
:global
t
:group
'electricity
(
if
electric-indent-mode
(
add-hook
'post-self-insert-hook
#'
electric-indent-post-self-insert-function
;; post-self-insert-hooks interact in non-trivial ways.
;; It turns out that electric-indent-mode generally works
;; better last.
'append
)
(
remove-hook
'post-self-insert-hook
#'
electric-indent-post-self-insert-function
)))
(
if
(
not
electric-indent-mode
)
(
remove-hook
'post-self-insert-hook
#'
electric-indent-post-self-insert-function
)
;; post-self-insert-hooks interact in non-trivial ways.
;; It turns out that electric-indent-mode generally works better if run
;; late, but still before blink-paren.
(
add-hook
'post-self-insert-hook
#'
electric-indent-post-self-insert-function
'append
)
;; FIXME: Ugly!
(
let
((
bp
(
memq
#'
blink-paren-post-self-insert-function
(
default-value
'post-self-insert-hook
))))
(
when
(
memq
#'
electric-indent-post-self-insert-function
bp
)
(
setcar
bp
#'
electric-indent-post-self-insert-function
)
(
setcdr
bp
(
cons
#'
blink-paren-post-self-insert-function
(
delq
#'
electric-indent-post-self-insert-function
(
cdr
bp
))))))))
;; Electric pairing.
...
...
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