aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit-config.el16
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