all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Lowe <richlowe@richlowe.net>
To: 19870@debbugs.gnu.org
Subject: bug#19870: 24.4.90; tramp sets bad PAGER, commands which reference it fail
Date: Sat, 14 Feb 2015 23:56:26 -0500	[thread overview]
Message-ID: <m2k2zjsrgl.fsf@richlowe.net> (raw)


Change ae5602c51c721196922620b263a490137bba7fe0 "Backport Tramp changes
from trunk." contained a chunk like this:

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 6f55b86..1976e0e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3967,15 +4076,22 @@ process to set up.  VEC specifies the connection."
   (let ((env (append (when (tramp-get-remote-locale vec) ; Discard `(nil)'.
 		       `(,(tramp-get-remote-locale vec)))
 		     (copy-sequence tramp-remote-process-environment)))
-	unset item)
+	unset vars item)
     (while env
       (setq item (tramp-compat-split-string (car env) "="))
       (setcdr item (mapconcat 'identity (cdr item) "="))
       (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
-	  (tramp-send-command
-	   vec (format "%s=%s; export %s" (car item) (cdr item) (car item)) t)
+	  (push (format "%s %s" (car item) (cdr item)) vars)
 	(push (car item) unset))
       (setq env (cdr env)))
+    (when vars
+      (tramp-send-command
+       vec
+       (format "while read var val; do export $var=$val; done <<'%s'\n%s\n%s"
+	       tramp-end-of-heredoc
+	       (mapconcat 'identity vars "\n")
+	       tramp-end-of-heredoc)
+       t))
     (when unset
       (tramp-send-command
        vec (format "unset %s" (mapconcat 'identity unset " ")) t))))


Presumably this is tidying as part of:
    (tramp-open-connection-setup-interactive-shell):
    Prefer utf-8 coding.  (Bug#17859)

Where `tramp-remote-process-environment' by default contains
"PAGER=\"\"", after this change we will export into the remote
environment literally PAGER="\"\"" (that is it will be in the environment, with the
value "").  Since "" isn't an application, things which use the pager
will then fail, much as if you had done:

  $ PAGER="\"\"" git log

You can reproduce this by running emacs -Q, opening a dired on a remote
directory under git control (C-x C-d /somehost:/some/directory/in/git),
and trying to run 'git show' (M-! git show).  This will fail, saying:
  "": : command not found

It's not clear to me whether the change quoted above is somehow flawed,
or whether the setting of PAGER in `tramp-remote-process-environment' is
flawed.  I think the setting is to workaround the fact that if the RHS
of the assignment in `tramp-remote-process-environment' is empty, we
won't actually do anything (which seems a bit weird, given the number of
variables in there that will be ignored), and the new code quoted above
results in more faithfully quoting things, triggering the bug.

In GNU Emacs 24.4.90.1 (i386-apple-darwin14.0.0, NS apple-appkit-1343.16)
 of 2015-02-12 on quisling.home
Repository revision: ae5602c51c721196922620b263a490137bba7fe0
Windowing system distributor `Apple', version 10.3.1343
Configured using:
 `configure --with-ns --without-pop'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Tramp: Opening connection for metropolis using scp...
Tramp: Sending command `exec ssh   -o ControlMaster=auto -o ControlPath='tramp.%r@%h:%p' -o ControlPersist=no -e none metropolis'
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `metropolis'
Tramp: Opening connection for metropolis using scp...done
ls does not support --dired; see `dired-use-ls-dired' for more details.
s-! is undefined
Quit

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache
tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cl-extra cl-loaddefs cl-lib cconv eieio-core gnus-util
mm-util mail-prsvr password-cache tramp-loaddefs trampver shell
pcomplete comint ansi-color ring format-spec advice help-fns dired
time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel ns-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process cocoa ns multi-tty emacs)

Memory information:
((conses 16 101198 8658)
 (symbols 48 20448 0)
 (miscs 40 46 198)
 (strings 32 21041 5061)
 (string-bytes 1 641937)
 (vectors 16 13414)
 (vector-slots 8 420900 6141)
 (floats 8 81 271)
 (intervals 56 1073 223)
 (buffers 960 14))





             reply	other threads:[~2015-02-15  4:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15  4:56 Richard Lowe [this message]
2015-02-15 15:22 ` bug#19870: 24.4.90; tramp sets bad PAGER, commands which reference it fail Michael Albinus
2015-02-15 20:20   ` Richard Lowe
2015-02-16  7:59     ` 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

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

  git send-email \
    --in-reply-to=m2k2zjsrgl.fsf@richlowe.net \
    --to=richlowe@richlowe.net \
    --cc=19870@debbugs.gnu.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.