|
1 | 1 | ;;; pythonic.el --- Utility functions for writing pythonic emacs package. -*- lexical-binding: t; -*- |
2 | 2 |
|
3 | | -;; Copyright (C) 2015-2018 by Artem Malyshev |
| 3 | +;; Copyright (C) 2015-2019 by Artem Malyshev |
4 | 4 |
|
5 | 5 | ;; Author: Artem Malyshev <proofit404@gmail.com> |
6 | 6 | ;; URL: https://github.com/proofit404/pythonic |
|
32 | 32 | (require 's) |
33 | 33 | (require 'f) |
34 | 34 |
|
| 35 | +(defgroup pythonic nil |
| 36 | + "Utility functions for writing pythonic emacs package." |
| 37 | + :group 'python) |
| 38 | + |
35 | 39 |
|
36 | 40 | ;;; Connection predicates. |
37 | 41 |
|
@@ -153,8 +157,15 @@ format." |
153 | 157 |
|
154 | 158 | ;;; Docker Compose. |
155 | 159 |
|
156 | | -(defvar pythonic-docker-compose-filename "docker-compose.yml") |
157 | | -(defvar pythonic-docker-compose-container-name nil) |
| 160 | +(defcustom pythonic-docker-compose-filename "docker-compose.yml" |
| 161 | + "File name of the docker-compose project file." |
| 162 | + :type 'string |
| 163 | + :safe 'stringp) |
| 164 | + |
| 165 | +(defcustom pythonic-docker-compose-service-name nil |
| 166 | + "Name of the default service to execute commands." |
| 167 | + :type 'string |
| 168 | + :safe 'stringp) |
158 | 169 |
|
159 | 170 | (defvar pythonic-read-docker-compose-file-code " |
160 | 171 | from __future__ import print_function |
@@ -222,8 +233,8 @@ print(json.dumps(yaml.safe_load(open(sys.argv[-1], 'r')))) |
222 | 233 | ;; should appears once in the selection and all volumes |
223 | 234 | ;; should be added to the alias list. |
224 | 235 | (volume (if (< 1 (length volumes)) |
225 | | - (if pythonic-docker-compose-container-name |
226 | | - pythonic-docker-compose-container-name |
| 236 | + (if pythonic-docker-compose-service-name |
| 237 | + pythonic-docker-compose-service-name |
227 | 238 | (assoc (completing-read "Service: " (mapcar 'car volumes) nil t) volumes)) |
228 | 239 | (car volumes))) |
229 | 240 | (service (car volume)) |
|
0 commit comments