summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2022-11-28 19:18:20 +0100
committerUlrich Müller <ulm@gentoo.org>2022-11-29 20:32:38 +0100
commita31d9b76f526c2be5e8edcb161e60a60aa8ecaa9 (patch)
treec888d785b4430e31ebc9bd9137d5eaf6aeaca00b
parentAllow multiple subcommands in one ebuild command (diff)
downloadebuild-mode-a31d9b76f526c2be5e8edcb161e60a60aa8ecaa9.tar.gz
ebuild-mode-a31d9b76f526c2be5e8edcb161e60a60aa8ecaa9.tar.bz2
ebuild-mode-a31d9b76f526c2be5e8edcb161e60a60aa8ecaa9.zip
New variable for additional subprocess environment
* ebuild-mode.el (ebuild-mode-process-environment): New custom variable. Bug 882055. (ebuild-run-command, ebuild-mode-run-pkgdev) (ebuild-mode-run-pkgcheck): Use it. Bug: https://bugs.gentoo.org/882055 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--ebuild-mode.el17
2 files changed, 19 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dcb1c0..3a941f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2022-11-28 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-mode-process-environment): New custom
+ variable. Bug 882055.
+ (ebuild-run-command, ebuild-mode-run-pkgdev)
+ (ebuild-mode-run-pkgcheck): Use it.
+
* ebuild-mode.el (ebuild-mode-ebuild-cmd-complete): New function,
completes multiple ebuild commands. Bug 882053.
(ebuild-run-command): Call it.
diff --git a/ebuild-mode.el b/ebuild-mode.el
index ad30996..5eb40a5 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -120,6 +120,14 @@ If nil, use two spaces."
:type 'boolean
:group 'ebuild)
+(defcustom ebuild-mode-process-environment
+ '("NOCOLOR=true")
+ "List of additional environment variables for subprocesses.
+Each element should be a string of the form NAME=VALUE. This will
+be prepended to `process-environment' when calling a subprocess."
+ :type '(repeat string)
+ :group 'ebuild)
+
;; Predicate function for comparison of architecture keywords
;; (needed for variable definitions below)
(defun ebuild-mode-arch-lessp (a b)
@@ -409,7 +417,8 @@ If nil, `compilation-mode' will be used.")
(error "No file for this buffer"))
(let* ((file (file-relative-name buffer-file-name))
(shell-command (format "ebuild %s %s" file command))
- (process-environment (cons "NOCOLOR=true" process-environment))
+ (process-environment (append ebuild-mode-process-environment
+ process-environment))
;;(compilation-mode-hook (lambda () (setq truncate-lines t)))
(compilation-buffer-name-function (lambda (mode) "*ebuild*")))
(if (featurep 'xemacs)
@@ -476,7 +485,8 @@ Like `compile', but with autocompletion for pkgdev."
(list (completing-read "Run pkgdev command: "
'ebuild-mode-command-complete
nil nil "pkgdev ")))
- (let ((process-environment (cons "NOCOLOR=true" process-environment))
+ (let ((process-environment (append ebuild-mode-process-environment
+ process-environment))
(compilation-buffer-name-function (lambda (mode) "*pkgdev*")))
(compile command)))
@@ -487,7 +497,8 @@ Like `compile', but with autocompletion for pkgcheck."
(list (completing-read "Run pkgcheck command: "
'ebuild-mode-command-complete
nil nil "pkgcheck ")))
- (let ((process-environment (cons "NOCOLOR=true" process-environment))
+ (let ((process-environment (append ebuild-mode-process-environment
+ process-environment))
(compilation-buffer-name-function (lambda (mode) "*pkgcheck*")))
(compile command)))