From: Juri Linkov <juri@jurta.org>
To: Trevor Spiteri <tspiteri@ieee.org>
Cc: 8340@debbugs.gnu.org
Subject: bug#8340: 23.2; recompile does not retain compilation-environment needed by vc-git-grep
Date: Mon, 05 Sep 2011 12:10:05 +0300 [thread overview]
Message-ID: <871uvvtkwi.fsf@mail.jurta.org> (raw)
In-Reply-To: <4D8B9138.5070701@ieee.org> (Trevor Spiteri's message of "Thu, 24 Mar 2011 18:45:12 +0000")
> In the function vc-git-grep inside vc-git.el, the compilation environment
> is set as
>
> (compilation-environment '("PAGER="))
>
> because git grep needs that. If I use M-x recompile in the *grep* buffer
> after using M-x vc-git-grep, compilation-environment is not set, and
> a warning that the "terminal is not fully functional" is displayed, one
> page of results is shown, and git grep blocks waiting on standard input,
> since it is using more as a pager.
>
> To fix this, I applied the following patch to compile.el that stores
> compile-environment in a similar way to default-directory. It works for me,
> but I do not really know elisp.
Generally it would be better to reuse `compilation-environment' and set
it buffer-locally in the *compilation* buffer, but there is another problem.
Some users might want to set `compilation-environment' in .emacs like:
(add-hook 'compilation-mode-hook
(lambda ()
(setq compilation-environment '("LANG=C"))))
See more in http://thread.gmane.org/gmane.emacs.devel/108353
But then let-binding (let ((compilation-environment '("PAGER="))))
in `vc-git-grep' is ineffective because `compilation-mode-hook'
overrides it. So `compilation-environment' should be defcustom
to avoid this problem.
I don't know whether it's good for defcustom to be buffer-local. But this
should fix both problems when `vc-git-grep' will add "PAGER=" to the
default or customized value of `compilation-environment' like
(let ((compilation-environment (cons "PAGER=" compilation-environment))))
next prev parent reply other threads:[~2011-09-05 9:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 18:45 bug#8340: 23.2; recompile does not retain compilation-environment needed by vc-git-grep Trevor Spiteri
2011-09-05 9:10 ` Juri Linkov [this message]
2011-09-06 9:27 ` Juri Linkov
2011-09-06 18:39 ` Stefan Monnier
2011-09-07 12:19 ` Juri Linkov
2011-09-07 13:36 ` Stefan Monnier
2011-09-08 12:12 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871uvvtkwi.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=8340@debbugs.gnu.org \
--cc=tspiteri@ieee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.