diff --git a/lisp/dconf.el b/lisp/dconf-mode.el similarity index 52% rename from lisp/dconf.el rename to lisp/dconf-mode.el index f43324d..971f027 100644 --- a/lisp/dconf.el +++ b/lisp/dconf-mode.el @@ -1,5 +1,8 @@ -;;; dconf.el --- Edit dconf settings in an emacs buffer +;;; 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 ;; from my vim config to modify and save the running GNOME state to files. @@ -15,16 +18,26 @@ (interactive) (shell-command (concat "cat " buffer-file-name - " | dconf load /org/gnome/" (file-name-base buffer-file-name) "/"))) + " | dconf load /org/gnome/" (file-name-base buffer-file-name) "/"))) +(defun dconf-dump-current-file () + "Load dconf's live registry into the current file." + (interactive) + (erase-buffer) + (shell-command + (concat "dconf dump /org/gnome/" (file-name-base buffer-file-name) "/") + (current-buffer))) (if (string-match "*.gsets" buffer-file-name) (progn - (add-hook) ;BufReadPre + ;; (add-hook) ;BufReadPre (conf-windows-mode) ;BufReadPost might be default - (add-hook after-save-hook - #'dconf-load-current-file) ) ) -(provide 'dconf) -;;; dconf.el ends here +(define-derived-mode dconf-mode conf-mode "Dconf" + (add-hook after-save-hook + #'dconf-load-current-file) + ) + +(provide 'dconf-mode) +;;; dconf-mode.el ends here