summaryrefslogtreecommitdiff
path: root/lisp/electric.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-08-22 00:14:07 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-08-22 00:14:07 +0200
commitae5fe348fb481c88bb2447197098ed9a47f128d6 (patch)
treeee84d981c98dadc39b6c667fba60063dce7819d6 /lisp/electric.el
parent29a989c02089162dd30132ab80e6eb4afb224446 (diff)
downloademacs-ae5fe348fb481c88bb2447197098ed9a47f128d6.tar.gz
Revert "Make the generalized buffer-local-variable obsolete"
This reverts commit bfe222288e02472bff0e1ab5ba7ef26af6a2769a. This led to the local modes not working.
Diffstat (limited to 'lisp/electric.el')
-rw-r--r--lisp/electric.el9
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.
)))