unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Daniel Pittman <dpittman@fb.com>
Cc: 18940@debbugs.gnu.org
Subject: bug#18940: 24.4; vc-hg does not disable pager, leading to hangs (at least with tramp)
Date: Sun, 09 Nov 2014 11:24:21 +0100	[thread overview]
Message-ID: <87y4rkhdt6.fsf@gmx.de> (raw)
In-Reply-To: <030C5AEB-C009-4995-B153-6EECD44802C8@fb.com> (Daniel Pittman's message of "Mon, 3 Nov 2014 21:47:14 +0000")

Daniel Pittman <dpittman@fb.com> writes:

> C-x C-f /sshx:dpittman@remotehost.local:/path/to/file/in/hg/repo.txt
>
> …and Emacs hangs.
>
> I had problems with the Hg backend hanging via tramp; checking showed that it
> was hung waiting on `less`, which was sitting there telling me that the
> terminal wasn't fully featured and could it please, kindly, have some human
> input to let it know that it was OK to continue.

<http://mercurial.selenic.com/wiki/PagerExtension> discusses the
problem, and proposes even a solution for "Tramp in Emacs" :-)

> Anyway, options that probably make sense to set to make this smoother:
>
> 1. `HGPLAIN` exists in the environment.
>
> This disables things that might change output, and is recommended for
> non-interactive calls to try and discourage random breakage.

I'm a little bit reluctant to add this per default to
`tramp-remote-process-environment'. There shouldn't be such default
application specific settings.

But the following patch might be sufficient (could you, please, test?):

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/lisp/vc/vc-hg.el.~118313~	2014-11-09 11:19:05.851785605 +0100
--- /home/albinus/src/emacs/lisp/vc/vc-hg.el	2014-11-09 11:13:53.255025363 +0100
***************
*** 210,220 ****
  			     ;; can parse the output.
  			     (append (list "TERM=dumb" "LANGUAGE=C")
  				     process-environment)))
! 			(process-file
! 			 vc-hg-program nil t nil
! 			 "--config" "alias.status=status"
! 			 "--config" "defaults.status="
! 			 "status" "-A" (file-relative-name file)))
                      ;; Some problem happened.  E.g. We can't find an `hg'
                      ;; executable.
                      (error nil)))))))
--- 210,227 ----
  			     ;; can parse the output.
  			     (append (list "TERM=dumb" "LANGUAGE=C")
  				     process-environment)))
! 			(if (file-remote-p file)
! 			    (process-file
! 			     "env" nil t nil
! 			     "HGPLAIN=1" vc-hg-program
! 			     "--config" "alias.status=status"
! 			     "--config" "defaults.status="
! 			     "status" "-A" (file-relative-name file))
! 			  (process-file
! 			   vc-hg-program nil t nil
! 			   "--config" "alias.status=status"
! 			   "--config" "defaults.status="
! 			   "status" "-A" (file-relative-name file))))
                      ;; Some problem happened.  E.g. We can't find an `hg'
                      ;; executable.
                      (error nil)))))))
--8<---------------cut here---------------end--------------->8---

> 3. --color never
>
> ...because if you have a tty, and less/hg think it is an interactive enough
> call to invoke the pager and complain to a human, you might well get color
> displayed as well.
>
> 4. --pager never
>
> ...because you just don't want to page the output for non-interactive use.

It looks, like you need to enable the respective extensions in your .hgrc.
Therefore, they cannot be added in vg-hg.el by default, I fear.

Best regards, Michael.





  parent reply	other threads:[~2014-11-09 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 21:47 bug#18940: 24.4; vc-hg does not disable pager, leading to hangs (at least with tramp) Daniel Pittman
     [not found] ` <handler.18940.B.141505143415260.ack@debbugs.gnu.org>
2014-11-03 22:13   ` bug#18940: Acknowledgement (24.4; vc-hg does not disable pager, leading to hangs (at least with tramp) ) Daniel Pittman
2014-11-09 10:24 ` Michael Albinus [this message]
2014-11-13 15:36   ` bug#18940: 24.4; vc-hg does not disable pager, leading to hangs (at least with tramp) Michael Albinus
2014-11-13 18:10     ` Stefan Monnier
2014-11-13 21:37       ` Michael Albinus
2014-11-14  1:49         ` Stefan Monnier
2014-11-16 10:55           ` Michael Albinus
2014-11-16 15:29             ` Eli Zaretskii
2014-11-16 18:38               ` Michael Albinus
2014-11-16 21:08               ` Stefan Monnier
2014-11-15  2:24 ` bug#18940: Enabling hg extensions Jordi Gutiérrez Hermoso
2014-11-15 16:00   ` Michael Albinus

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4rkhdt6.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=18940@debbugs.gnu.org \
    --cc=dpittman@fb.com \
    /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 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).