diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-21 23:38:09 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-21 23:38:09 +0200 |
commit | bfe222288e02472bff0e1ab5ba7ef26af6a2769a (patch) | |
tree | e3c79fb1621de447ad1b0c2d5a580275422a71f5 /lisp/electric.el | |
parent | efd95300c7ce5fcd565bb891b8559c1430873072 (diff) | |
download | emacs-bfe222288e02472bff0e1ab5ba7ef26af6a2769a.tar.gz emacs-bfe222288e02472bff0e1ab5ba7ef26af6a2769a.tar.bz2 emacs-bfe222288e02472bff0e1ab5ba7ef26af6a2769a.zip |
Make the generalized buffer-local-variable obsolete
* lisp/paren.el (show-paren-local-mode):
* lisp/electric.el (electric-indent-local-mode)
(electric-layout-local-mode, electric-quote-local-mode):
* lisp/elec-pair.el (electric-pair-local-mode): Don't use it.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Autoload.
* lisp/emacs-lisp/gv.el (buffer-local-variable): Make obsolete
(bug#26624).
* lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable): Move
to allow usage.
Diffstat (limited to 'lisp/electric.el')
-rw-r--r-- | lisp/electric.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/electric.el b/lisp/electric.el index f2ff837333f..ae9b5ee1622 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -340,12 +340,13 @@ use `electric-indent-local-mode'." ;;;###autoload (define-minor-mode electric-indent-local-mode "Toggle `electric-indent-mode' only in this buffer." - :variable (buffer-local-value 'electric-indent-mode (current-buffer)) + :lighter nil (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. ))) @@ -484,12 +485,13 @@ 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." - :variable (buffer-local-value 'electric-layout-mode (current-buffer)) + :lighter nil (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. ))) @@ -661,12 +663,13 @@ use `electric-quote-local-mode'." ;;;###autoload (define-minor-mode electric-quote-local-mode "Toggle `electric-quote-mode' only in this buffer." - :variable (buffer-local-value 'electric-quote-mode (current-buffer)) + :lighter nil (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. ))) |