From 94b178505ed3de6746236b2342d26f15787d4825 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Sun, 19 Jun 2022 16:57:03 -0800 Subject: [PATCH] dconf: mostly works --- lisp/dconf-mode.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lisp/dconf-mode.el b/lisp/dconf-mode.el index 971f027..a762adf 100644 --- a/lisp/dconf-mode.el +++ b/lisp/dconf-mode.el @@ -1,6 +1,4 @@ ;;; dconf-mode.el --- Edit dconf settings in an emacs buffer -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.gsets" . dconf-mode)) ;;; Commentary: ;; I haven't completely given up on GNOME. This is a little wrapper I've ported @@ -13,6 +11,8 @@ ;; autocmd BufWritePost *.gsets silent !cat % | dconf load /org/gnome/%:t:r/ ;;; Code: + + (defun dconf-load-current-file () "Load the current file into dconf's live registry." (interactive) @@ -27,17 +27,13 @@ (concat "dconf dump /org/gnome/" (file-name-base buffer-file-name) "/") (current-buffer))) -(if (string-match "*.gsets" buffer-file-name) - (progn - ;; (add-hook) ;BufReadPre - (conf-windows-mode) ;BufReadPost might be default - ) - ) - (define-derived-mode dconf-mode conf-mode "Dconf" - (add-hook after-save-hook - #'dconf-load-current-file) - ) + "Major mode for interacting with the dconf database." + (add-hook 'after-save-hook 'dconf-load-current-file) + :after-hook (dconf-dump-current-file)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.gsets" . dconf-mode)) (provide 'dconf-mode) ;;; dconf-mode.el ends here