diff options
| author | Stefan Monnier | 2013-11-17 21:01:34 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-11-17 21:01:34 -0500 |
| commit | 25158c76b277cc2787c86c031cfdb5df65efa73f (patch) | |
| tree | 98a60cdea3533f0af2ddb9fe95d0d63d8e892483 | |
| parent | 1f35d401baa3e1d5715fecc734e803b538afa257 (diff) | |
| download | emacs-25158c76b277cc2787c86c031cfdb5df65efa73f.tar.gz emacs-25158c76b277cc2787c86c031cfdb5df65efa73f.zip | |
* lisp/electric.el (electric-indent-mode-map): Remove.
(electric-indent-mode): Change the global-map instead.
Fixes: debbugs:15915
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/electric.el | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e2d1747795c..f0ea7a93526 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | 2013-11-18 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-11-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * textmodes/text-mode.el (paragraph-indent-minor-mode): Use add-function. | 3 | * electric.el (electric-indent-mode-map): Remove. |
| 4 | (electric-indent-mode): Change the global-map instead (bug#15915). | ||
| 5 | |||
| 6 | * textmodes/text-mode.el (paragraph-indent-minor-mode): | ||
| 7 | Use add-function. | ||
| 4 | 8 | ||
| 5 | 2013-11-17 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2013-11-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 6 | 10 | ||
diff --git a/lisp/electric.el b/lisp/electric.el index bb93a1615a7..04d0bd3e935 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -273,12 +273,6 @@ mode set `electric-indent-inhibit', but this can be used as a workaround.") | |||
| 273 | (let ((electric-indent-mode nil)) | 273 | (let ((electric-indent-mode nil)) |
| 274 | (newline arg 'interactive))) | 274 | (newline arg 'interactive))) |
| 275 | 275 | ||
| 276 | (defvar electric-indent-mode-map | ||
| 277 | (let ((map (make-sparse-keymap))) | ||
| 278 | (define-key map [?\C-j] 'electric-indent-just-newline) | ||
| 279 | map) | ||
| 280 | "Keymap used for `electric-mode-mode'.") | ||
| 281 | |||
| 282 | ;;;###autoload | 276 | ;;;###autoload |
| 283 | (define-minor-mode electric-indent-mode | 277 | (define-minor-mode electric-indent-mode |
| 284 | "Toggle on-the-fly reindentation (Electric Indent mode). | 278 | "Toggle on-the-fly reindentation (Electric Indent mode). |
| @@ -291,8 +285,14 @@ the hook `electric-indent-functions' returns non-nil, or you | |||
| 291 | insert a character from `electric-indent-chars'." | 285 | insert a character from `electric-indent-chars'." |
| 292 | :global t :group 'electricity | 286 | :global t :group 'electricity |
| 293 | (if (not electric-indent-mode) | 287 | (if (not electric-indent-mode) |
| 294 | (remove-hook 'post-self-insert-hook | 288 | (progn |
| 295 | #'electric-indent-post-self-insert-function) | 289 | (when (eq (lookup-key global-map [?\C-j]) |
| 290 | 'electric-indent-just-newline) | ||
| 291 | (define-key global-map [?\C-j] 'newline-and-indent)) | ||
| 292 | (remove-hook 'post-self-insert-hook | ||
| 293 | #'electric-indent-post-self-insert-function)) | ||
| 294 | (when (eq (lookup-key global-map [?\C-j]) 'newline-and-indent) | ||
| 295 | (define-key global-map [?\C-j] 'electric-indent-just-newline)) | ||
| 296 | ;; post-self-insert-hooks interact in non-trivial ways. | 296 | ;; post-self-insert-hooks interact in non-trivial ways. |
| 297 | ;; It turns out that electric-indent-mode generally works better if run | 297 | ;; It turns out that electric-indent-mode generally works better if run |
| 298 | ;; late, but still before blink-paren. | 298 | ;; late, but still before blink-paren. |