Function: sops--restore-after-major-mode-change

sops--restore-after-major-mode-change is a natively compiled function defined in sops.el.

Signature

(sops--restore-after-major-mode-change)

Documentation

Re-install sops-mode buffer protections after a major-mode change.

kill-all-local-variables wipes our hook entries and buffer-local var settings, but sops-mode(var)/sops-mode(fun) itself is permanent-local and survives. This function checks for that surviving flag and re-installs the rest.

Source Code

;; Defined in /nix/store/vihl6lkzddv9xrsrsznvqdjq27g2i30p-emacs-packages-deps/share/emacs/site-lisp/elpa/sops-20260920.2121/sops.el
(defun sops--restore-after-major-mode-change ()
  "Re-install sops-mode buffer protections after a major-mode change.
`kill-all-local-variables' wipes our hook entries and buffer-local var
settings, but `sops-mode' itself is permanent-local and survives.  This
function checks for that surviving flag and re-installs the rest."
  (when sops-mode
    (setq-local make-backup-files nil)
    (setq-local buffer-auto-save-file-name nil)
    (setq-local revert-buffer-function #'sops--revert-buffer)
    (add-hook 'write-contents-functions
              #'sops--write-contents-function nil t)
    (auto-revert-mode 1)
    (setq-local apheleia-inhibit t)))