diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-03-19 09:17:10 +0100 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-03-19 09:17:10 +0100 |
commit | 10541ce5fe70585b6281ceea8cdb638228b52d12 (patch) | |
tree | dec8cb0ed37b966e7347988d2831201036967a41 | |
parent | 71d438ad345f85847ab1b77c9cc99133963da47f (diff) |
Implement the core command
Also fix the declaration of `edit-config-files'.
-rw-r--r-- | edit-config.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/edit-config.el b/edit-config.el index 660238a..3477024 100644 --- a/edit-config.el +++ b/edit-config.el @@ -35,7 +35,21 @@ 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.") +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 |