diff options
Diffstat (limited to 'lisp/electric.el')
-rw-r--r-- | lisp/electric.el | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/electric.el b/lisp/electric.el index ae9b5ee1622..f2ff837333f 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -340,13 +340,12 @@ use `electric-indent-local-mode'." ;;;###autoload (define-minor-mode electric-indent-local-mode "Toggle `electric-indent-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-indent-mode (current-buffer)) (cond ((eq electric-indent-mode (default-value 'electric-indent-mode)) (kill-local-variable 'electric-indent-mode)) ((not (default-value 'electric-indent-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-indent-mode 1) ; Setup the hooks. (setq-default electric-indent-mode nil) ; But keep it globally disabled. ))) @@ -485,13 +484,12 @@ The variable `electric-layout-rules' says when and how to insert newlines." ;;;###autoload (define-minor-mode electric-layout-local-mode "Toggle `electric-layout-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-layout-mode (current-buffer)) (cond ((eq electric-layout-mode (default-value 'electric-layout-mode)) (kill-local-variable 'electric-layout-mode)) ((not (default-value 'electric-layout-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-layout-mode 1) ; Setup the hooks. (setq-default electric-layout-mode nil) ; But keep it globally disabled. ))) @@ -663,13 +661,12 @@ use `electric-quote-local-mode'." ;;;###autoload (define-minor-mode electric-quote-local-mode "Toggle `electric-quote-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-quote-mode (current-buffer)) (cond ((eq electric-quote-mode (default-value 'electric-quote-mode)) (kill-local-variable 'electric-quote-mode)) ((not (default-value 'electric-quote-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-quote-mode 1) ; Setup the hooks. (setq-default electric-quote-mode nil) ; But keep it globally disabled. ))) |