* bug#45095: [PATCH] lisp/progmodes/compile.el: only use comint-term-environment under comint
@ 2020-12-07 9:04 Alyssa Ross
2020-12-07 15:57 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Ross @ 2020-12-07 9:04 UTC (permalink / raw)
To: 45095; +Cc: Alyssa Ross
comint-term-environment is used for configuring the environment for
terminal output under comint. If compile is being used with a
different major mode, that mode probably can't handle the fancy
terminfo output that comint can, so comint-term-environment should
only be used under comint or a derived mode.
; Tested with emacs -Q as follows:
;
; (1) Set comint-terminfo-terminal to "dumb-emacs-ansi", provided by
; recent ncurses:
;
; (setq comint-terminfo-terminal "dumb-emacs-ansi") C-x C-e
;
; (2) Verify that no uninterpreted control characters are displayed by
; (compile "grep --color=auto Emacs README") C-x C-e
;
; (3) Verify that grep knows it can output color when using comint:
; (compile "grep --color=auto Emacs README" t) C-x C-e
;
; Prior to this change, grep in (2) would output control characters,
; which would be displayed uninterpreted in the buffer.
---
I haven't got my copyright papers sorted yet, so hopefully this change
is also small enough that that doesn't matter.
lisp/progmodes/compile.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 787f5d5ef3..b4bcc3f2d2 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1868,7 +1868,8 @@ compilation-start
(let ((process-environment
(append
compilation-environment
- (comint-term-environment)
+ (when (derived-mode-p 'comint-mode)
+ (comint-term-environment))
(list (format "INSIDE_EMACS=%s,compile" emacs-version))
(copy-sequence process-environment))))
(set (make-local-variable 'compilation-arguments)
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#45095: [PATCH] lisp/progmodes/compile.el: only use comint-term-environment under comint
2020-12-07 9:04 bug#45095: [PATCH] lisp/progmodes/compile.el: only use comint-term-environment under comint Alyssa Ross
@ 2020-12-07 15:57 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-07 15:57 UTC (permalink / raw)
To: Alyssa Ross; +Cc: 45095
Alyssa Ross <hi@alyssa.is> writes:
> comint-term-environment is used for configuring the environment for
> terminal output under comint. If compile is being used with a
> different major mode, that mode probably can't handle the fancy
> terminfo output that comint can, so comint-term-environment should
> only be used under comint or a derived mode.
Makes sense -- applied to Emacs 28.
[...]
> I haven't got my copyright papers sorted yet, so hopefully this change
> is also small enough that that doesn't matter.
Yup.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-07 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 9:04 bug#45095: [PATCH] lisp/progmodes/compile.el: only use comint-term-environment under comint Alyssa Ross
2020-12-07 15:57 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).