;;; edit-config.el --- Conveniently edit config files -*- lexical-binding: t; -*- ;; Copyright (C) 2024 Tristan Riehs ;; Author: Tristan Riehs ;; Keywords: convenience ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; This package aims at providing a convenient way of editing the various ;; configuration files you have on your system. The main thins you should ;; be interested in are `edit-config-files' and `edit-config'. ;;; Code: (defgroup edit-config nil "Conveniently edit config files." :group 'emacs :prefix "edit-config") (defcustom edit-config-files nil "The list of config files. Each element of this list has the form (LABEL . FILENAME). LABEL is what is displayed in the prompt of `edit-config', and FILENAME is the actual configuration file." :group 'edit-config :type '(alist :key-type string :value-type string)) ;;;###autoload (defun edit-config (label) "Edit the config file associated to LABEL." (interactive (list (if edit-config-files (completing-read "Config: " edit-config-files nil t) nil))) (if label (find-file (alist-get label edit-config-files nil nil 'string-equal)) (message "No config file to propose, have you you customized \ `edit-config-files' ?"))) (provide 'edit-config) ;;; edit-config.el ends here