[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r106444: * lisp/electric.el (electric
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r106444: * lisp/electric.el (electric-indent-mode): Fix last change (too optimistic). |
Date: |
Sun, 20 Nov 2011 01:29:57 -0500 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 106444
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2011-11-20 01:29:57 -0500
message:
* lisp/electric.el (electric-indent-mode): Fix last change (too optimistic).
modified:
lisp/ChangeLog
lisp/electric.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-11-20 04:33:36 +0000
+++ b/lisp/ChangeLog 2011-11-20 06:29:57 +0000
@@ -1,5 +1,7 @@
2011-11-20 Stefan Monnier <address@hidden>
+ * 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):
=== modified file 'lisp/electric.el'
--- a/lisp/electric.el 2011-11-11 15:55:24 +0000
+++ b/lisp/electric.el 2011-11-20 06:29:57 +0000
@@ -260,15 +260,23 @@
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r106444: * lisp/electric.el (electric-indent-mode): Fix last change (too optimistic).,
Stefan Monnier <=