GNU bug report logs - #57556
28.1; Eshell not finding executables in PATH when tramp-integration loaded

Previous Next

Package: emacs;

Reported by: Colton Lewis <coltonlewis <at> google.com>

Date: Sat, 3 Sep 2022 05:04:02 UTC

Severity: normal

Found in version 28.1

Fixed in version 28.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57556 in the body.
You can then email your comments to 57556 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 03 Sep 2022 05:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Colton Lewis <coltonlewis <at> google.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Sep 2022 05:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Colton Lewis <coltonlewis <at> google.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1;
 Eshell not finding executables in PATH when tramp-integration loaded
Date: Sat, 03 Sep 2022 05:03:20 +0000
This is related to bug #57370 which I reported earlier. That bug can be
closed as my reproduction instructions there were incorrect and my title
did not capture the root of the problem. The real problem only seems to
appear when loading the included library tramp-integration.

1. Create an executable script ~/test-bin/test.sh
2. emacs -Q -l tramp-integration
3. Eval the elisp snippet:
`(setenv "PATH" (concat (expand-file-name "~/test-bin") ":"  
(getenv "PATH")))`
4. Start eshell
5. test.sh
6. Observe command not found error


In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33,  
cairo version 1.16.0)
 of 2022-06-27, modified by Debian built on kokoro-ubuntu
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Debian GNU/Linux rodete

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
  
--enable-locallisppath=/etc/google-emacs:/usr/local/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/site-lisp:/usr/local/share/google-emacs/site-lisp:/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/site-lisp:/usr/share/google-emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --program-prefix=google- --disable-silent-rules
 GOOGLE_VERSION=28.1+gg1+1.20220627.053402.rc213 --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
  
--enable-locallisppath=/etc/google-emacs:/usr/local/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/site-lisp:/usr/local/share/google-emacs/site-lisp:/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/site-lisp:/usr/share/google-emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --program-prefix=google- --disable-silent-rules
 GOOGLE_VERSION=28.1+gg1+1.20220627.053402.rc213 --with-cairo
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2
  
-ffile-prefix-map=/build/google-emacs-V4HnnR/google-emacs-28.1+gg1+1.20220627.053402.rc213=.  
-fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  t: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  google-tramp-direct-mode: t
  global-subword-mode: t
  subword-mode: t
  google-emacs-support-show-upgrade-mode: t
  editorconfig-mode: t
  google3-build-global-integrate-build-manipulation-mode: t
  google3-build-integrate-build-manipulation-mode: t
  google-kg-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/f/f-shortdoc  
hides  
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/f/google/f-shortdoc
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/async/smtpmail-async  
hides  
/usr/share/google-emacs/site-lisp/elpa/async-1.9.3/smtpmail-async
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/async/async  
hides  
/usr/share/google-emacs/site-lisp/elpa/async-1.9.3/async
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/async/async-bytecomp  
hides  
/usr/share/google-emacs/site-lisp/elpa/async-1.9.3/async-bytecomp
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/async/dired-async  
hides  
/usr/share/google-emacs/site-lisp/elpa/async-1.9.3/dired-async
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-clang  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-clang
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-tng  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-tng
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-oddmuse  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-oddmuse
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-bbdb  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-bbdb
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-keywords  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-keywords
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-capf  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-capf
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-dabbrev-code  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-dabbrev-code
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-tempo  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-tempo
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-ispell  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-ispell
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-dabbrev  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-dabbrev
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-abbrev  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-abbrev
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-elisp  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-elisp
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-yasnippet  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-yasnippet
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-cmake  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-cmake
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-etags  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-etags
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-template  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-template
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-files  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-files
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-gtags  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-gtags
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-nxml  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-nxml
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-css  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-css
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/company_mode/company-semantic  
hides  
/usr/share/google-emacs/site-lisp/elpa/company-0.9.13/company-semantic
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/dash/dash  
hides  
/usr/share/google-emacs/site-lisp/elpa/dash-2.19.1/dash
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/epl/epl  
hides  
/usr/share/google-emacs/site-lisp/elpa/epl-0.9/epl
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/f/f  
hides /usr/share/google-emacs/site-lisp/elpa/f-0.20.0/f
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/flycheck/flycheck  
hides  
/usr/share/google-emacs/site-lisp/elpa/flycheck-32snapshot/flycheck
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/ht/ht  
hides  
/usr/share/google-emacs/site-lisp/elpa/ht-2.3/ht
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/lv/lv  
hides  
/usr/share/google-emacs/site-lisp/elpa/lv-0.15.0/lv
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/memoize/memoize  
hides  
/usr/share/google-emacs/site-lisp/elpa/memoize-1.1/memoize
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/pkg_info/pkg-info  
hides  
/usr/share/google-emacs/site-lisp/elpa/pkg-info-0.6/pkg-info
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/popup/popup  
hides  
/usr/share/google-emacs/site-lisp/elpa/popup-0.5.8/popup
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/s/s  
hides /usr/share/google-emacs/site-lisp/elpa/s-1.12.0/s
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/spinner/spinner  
hides  
/usr/share/google-emacs/site-lisp/elpa/spinner-1.7.4/spinner
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/yasnippet/yasnippet  
hides  
/usr/share/google-emacs/site-lisp/elpa/yasnippet-0.14.0/yasnippet
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/jsonrpc/jsonrpc  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/jsonrpc
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/transient/lisp/transient  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/transient
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/flymake/flymake  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/progmodes/flymake
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/xref/xref  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/progmodes/xref
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/project/project  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/progmodes/project
/usr/share/google-emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/emacs-lisp/let-alist
/usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/eldoc/eldoc  
hides  
/usr/share/google-emacs/28.1+gg1+1.20220627.053402.rc213/lisp/emacs-lisp/eldoc

Features:
(shadow mail-extr emacsbug rmail-spam-filter rmailedit rmailsort
undigest rmailout rmailkwd qp rmailsum semantic/symref/grep
semantic/symref semantic/util-modes semantic/util semantic semantic/tag
semantic/lex semantic/fw mode-local cedet cl-print rst google3-ffap ffap
grep apropos pcmpl-gnu tabify woman man find-dired pcmpl-unix bookmark
magit-bundle eieio-opt speedbar ezimage dframe find-func calc-alg
tramp-cache em-unix em-term term disp-table ehelp em-script em-prompt
em-ls em-hist em-pred em-glob em-cmpl em-dirs esh-var em-basic em-banner
em-alias esh-mode eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util pulse color etags fileloop calc-stuff
calc-ext calc-misc calc-menu calc calc-loaddefs rect calc-macs misearch
multi-isearch sort goto-addr vc-mtn vc-bzr vc-src vc-sccs vc-svn vc-cvs
vc-rcs bug-reference help-fns radix-tree face-remap magit-version
magit-bookmark git-rebase magit-extras magit-sparse-checkout
magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util magit-subtree magit-patch
magit-submodule magit-obsolete magit-popup magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
magit-diff smerge-mode diff git-commit log-edit pcvs-util add-log
magit-core magit-autorevert magit-margin magit-transient magit-process
magit-mode transient magit-git magit-base magit-section crm compat-27
compat-26 mule-util jka-compr rmailmm protobuffer which-func
reformat-file apply-ed-script message rmc puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
dired-aux dired dired-loaddefs autorevert filenotify vc-git vc-fig vc-hg
diff-mode vc vc-dispatcher editorconfig-core editorconfig-core-handle
editorconfig-fnmatch ido-completing-read+ memoize cus-edit pp cus-start
wid-edit minibuf-eldef google-tramp cap-words superword subword desktop
frameset cus-load edmacro kmacro google-sendgmr sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils google google-emacs-support
editorconfig google-log gud url-sso google3-build-fn google-imports
google3 google-gud google-comint google-kg google-trailing-whitespace
google-coding-style python-custom sh-script smie python tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 time-date ls-lisp js imenu cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine google-codemaker
google-process google-emacs-utilities with-editor cl-extra help-mode
server compat pcase f f-shortdoc shortdoc dash s aio generator
emacs-google-config-loaddefs google-paths xdg rx google-platform sql
view ess-site ess-toolbar ess-mouse mouseme ess-swv ess-noweb
ess-noweb-font-lock-mode ess-jags-d ess-bugs-l essd-els ess-xls-d
ess-vst-d ess-stata-mode ess-stata-lang cc-vars cc-defs make-regexp
ess-sp6w-d ess-sp5-d ess-sp4-d ess-sas-d ess-sas-l ess-sas-a ess-s4-d
ess-s3-d ess-omg-d ess-omg-l ess-arc-d ess-lsp-l ess-sp6-d ess-dde
ess-sp3-d ess-julia julia-mode cl ess-r-mode ess-r-flymake flymake-proc
flymake warnings thingatpt ess-r-xref xref project ess-trns
ess-r-package shell pcomplete ess-r-syntax ess-r-completion ess-roxy
ess-rd essddr noutline outline easy-mmode hideshow ess-s-lang ess-help
info ess-mode ess ess-noweb-mode ess-inf ess-tracebug advice format-spec
ess-generics compile text-property-search ess-utils ido ess-custom
executable comint ansi-color ring package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 614935 72899)
 (symbols 48 36853 6)
 (strings 32 163952 30759)
 (string-bytes 1 5377096)
 (vectors 16 74674)
 (vector-slots 8 1217245 548922)
 (floats 8 315 517)
 (intervals 56 17337 921)
 (buffers 992 51))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 03 Sep 2022 12:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Colton Lewis <coltonlewis <at> google.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 03 Sep 2022 14:26:45 +0200
Colton Lewis <coltonlewis <at> google.com> writes:

> This is related to bug #57370 which I reported earlier. That bug can be
> closed as my reproduction instructions there were incorrect and my title
> did not capture the root of the problem.

Now closed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 18 Sep 2022 11:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Colton Lewis via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: Colton Lewis <coltonlewis <at> google.com>, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 18 Sep 2022 13:18:37 +0200
[Message part 1 (text/plain, inline)]
Colton Lewis via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

Hi Colton,

> 1. Create an executable script ~/test-bin/test.sh
> 2. emacs -Q -l tramp-integration
> 3. Eval the elisp snippet:
> `(setenv "PATH" (concat (expand-file-name "~/test-bin") ":" (getenv
> "PATH")))`
> 4. Start eshell
> 5. test.sh
> 6. Observe command not found error

I've fixed this in the emacs-28 branch of the git repository, will be
merged to the master branch next days. Do yo have a chance to test? As
reference, I've appended the patch.

It isn't known yet whether there will be another Emacs 28 release, so
this change will appear in either Emacs 28.3 or 29.1. But you don't need
to wait that long, the next Tramp 2.5.3.3 release on GNU ELPA will carry
this patch as well.

Best regards, Michael.

[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 18 Sep 2022 11:20:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 18 Sep 2022 18:55:01 GMT) Full text and rfc822 format available.

Message #17 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>, 57556 <at> debbugs.gnu.org
Cc: coltonlewis <at> google.com
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 18 Sep 2022 11:54:15 -0700
On 9/18/2022 4:18 AM, Michael Albinus wrote:
> I've fixed this in the emacs-28 branch of the git repository, will be
> merged to the master branch next days. Do yo have a chance to test? As
> reference, I've appended the patch.

For what it's worth, I've started on a more-elaborate patch for this 
that would move all this into Eshell and allow manipulating Eshell's 
PATH variable on remote hosts too. (Eshell's codebase already has some 
special handling for Tramp, so I think it would be reasonable for Eshell 
to handle Tramp integration here, rather than the other way around.)

My patch needs a couple preliminary fixes though so it'll probably take 
a few days at least until I have something ready for people to look at.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 18 Sep 2022 19:08:01 GMT) Full text and rfc822 format available.

Message #20 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: coltonlewis <at> google.com, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 18 Sep 2022 21:07:29 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> For what it's worth, I've started on a more-elaborate patch for this
> that would move all this into Eshell and allow manipulating Eshell's
> PATH variable on remote hosts too. (Eshell's codebase already has some
> special handling for Tramp, so I think it would be reasonable for
> Eshell to handle Tramp integration here, rather than the other way
> around.)
>
> My patch needs a couple preliminary fixes though so it'll probably
> take a few days at least until I have something ready for people to
> look at.

Much appreciated! For possible Tramp changes please take into account,
that Tramp 2.6 should be backward compatible down to Emacs 26.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Thu, 22 Sep 2022 17:24:01 GMT) Full text and rfc822 format available.

Message #23 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Colton Lewis <coltonlewis <at> google.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Jim Porter <jporterbugs <at> gmail.com>, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Thu, 22 Sep 2022 12:23:21 -0500
Thank you Michael. I have tested and can confirm your patch solves my problem.

On Sun, Sep 18, 2022 at 2:07 PM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> Jim Porter <jporterbugs <at> gmail.com> writes:
>
> Hi Jim,
>
> > For what it's worth, I've started on a more-elaborate patch for this
> > that would move all this into Eshell and allow manipulating Eshell's
> > PATH variable on remote hosts too. (Eshell's codebase already has some
> > special handling for Tramp, so I think it would be reasonable for
> > Eshell to handle Tramp integration here, rather than the other way
> > around.)
> >
> > My patch needs a couple preliminary fixes though so it'll probably
> > take a few days at least until I have something ready for people to
> > look at.
>
> Much appreciated! For possible Tramp changes please take into account,
> that Tramp 2.6 should be backward compatible down to Emacs 26.
>
> Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Thu, 22 Sep 2022 17:56:03 GMT) Full text and rfc822 format available.

Notification sent to Colton Lewis <coltonlewis <at> google.com>:
bug acknowledged by developer. (Thu, 22 Sep 2022 17:56:03 GMT) Full text and rfc822 format available.

Message #28 received at 57556-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Colton Lewis <coltonlewis <at> google.com>
Cc: Jim Porter <jporterbugs <at> gmail.com>, 57556-done <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Thu, 22 Sep 2022 19:55:15 +0200
Version: 28.3

Colton Lewis <coltonlewis <at> google.com> writes:

Hi Colton,

> Thank you Michael. I have tested and can confirm your patch solves my problem.

Thanks for the feedback. I'm closing the bug.

There will be another patch by Jim. But this is for Emacs 29 only I
guess, and it will override this change then w/o regression.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 30 Sep 2022 03:55:02 GMT) Full text and rfc822 format available.

Message #31 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: 57556 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, coltonlewis <at> google.com
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Thu, 29 Sep 2022 20:54:43 -0700
[Message part 1 (text/plain, inline)]
On 9/22/2022 10:55 AM, Michael Albinus wrote:
> There will be another patch by Jim. But this is for Emacs 29 only I
> guess, and it will override this change then w/o regression.

It took a lot longer than anticipated, but here's a patch series to give 
Eshell full support for a Tramp-aware $PATH. This ended up considerably 
more elaborate than intended, mostly because of patch #3.

If people prefer, I could file a separate bug # for this set of changes, 
but I thought it would be better to track it here.

Here's a brief summary of everything I changed, and my reasoning. I'm 
still thinking about some of the changes myself, but I think this is 
complete enough for others to take a look at and provide feedback if 
they want.

Patch #2: Obsolete 'eshell/define'
----------------------------------------

I'm pretty sure this function never worked, since it adds Eshell 
variable aliases in a form that the rest of the code can't handle. If 
I'm wrong about this and someone can show how it should work, I'm happy 
to get rid of this patch and replace it with any fixes necessitated by 
my other patches.

Patch #3: Allow setting variable aliases
----------------------------------------

Since the plan is to make $PATH into a variable alias so that Eshell can 
do the right thing when changing directories to a different host, I 
wanted to be sure users can *set* variable aliases so that updating 
$PATH will be easy. This adds the ability to do that, along with a new 
"set" command in Eshell. That lets you set either environment variables 
or Lisp variables (note that "#'" is just Eshell's way of spelling "'", 
since a single-quote is used for literal strings in Eshell):

  set ENV_VAR value
  set #'lisp-var value

I debated on the name, since people might think it's more like Bash's 
"set" than Lisp's "set", but Eshell already has "setq", so I think "set" 
makes sense.

However, you can set these in other ways too:

  export ENV_VAR=value
  setq lisp-var value

Really, the "set" function is probably optional, but it seemed more 
convenient to me when I was trying these patches out, and I think it's a 
nice middle ground between Lispiness and sh-ness.

Patch #4: Make $PATH a variable alias
----------------------------------------

This stores the $PATH in an alist indexed by host, similar to 
'grep-host-defaults-alist'. For consistency, it now derives its value 
from '(exec-path)' everywhere (formerly, it used '(getenv "PATH") for 
local hosts and '(exec-path)' for Tramp).

This is likely an incompatible change for some users if they call 
(setenv "PATH" "foobar") in their init scripts, but it's easy enough to 
fix: just make the corresponding changes to 'exec-path' too. That said, 
if people think compatibility is more important, I could change this to 
use '(getenv "PATH")' for local directories.

These changes would probably be good to test on MS-Windows as well, 
since MS-Windows uses a different path-separator, so the code has to be 
pretty careful to use the right separator for the right system. I don't 
have Emacs builds set up on an MS-Windows system at the moment (though 
I've been meaning to).
[0001-Allow-ignoring-errors-when-calling-eshell-match-comm.patch (text/plain, attachment)]
[0002-Obsolete-eshell-define.patch (text/plain, attachment)]
[0003-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch (text/plain, attachment)]
[0004-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch (text/plain, attachment)]
[0005-Print-the-correct-PATH-when-Eshell-s-which-fails-to-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 01 Oct 2022 20:27:02 GMT) Full text and rfc822 format available.

Message #34 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: coltonlewis <at> google.com, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 01 Oct 2022 22:25:52 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

I didn't install your patches, but I gave them a cursory review.

> Patch #3: Allow setting variable aliases
> ----------------------------------------
>
> Since the plan is to make $PATH into a variable alias so that Eshell
> can do the right thing when changing directories to a different host,
> I wanted to be sure users can *set* variable aliases so that updating
> $PATH will be easy. This adds the ability to do that, along with a new
> "set" command in Eshell. That lets you set either environment
> variables or Lisp variables (note that "#'" is just Eshell's way of
> spelling "'", since a single-quote is used for literal strings in
> Eshell):
>
>   set ENV_VAR value
>   set #'lisp-var value

Well, in Elisp the #'symbol read syntax is used for function names, see
(info "(elisp) Special Read Syntax")

So it is surprising to see it used for variable names.

> Patch #4: Make $PATH a variable alias
> ----------------------------------------
>
> This stores the $PATH in an alist indexed by host, similar to
> 'grep-host-defaults-alist'. For consistency, it now derives its value
> from '(exec-path)' everywhere (formerly, it used '(getenv "PATH") for
> local hosts and '(exec-path)' for Tramp).

Again, no possibility to use connection-local variables? You use them
already by calling (path-separator) ...

Personally I believe 'grep-host-defaults-alist' shall also be changed to
a connection-local mechanism, but likely, this would break too much code
in the wild.

> -(defun eshell-get-path ()
> +(make-obsolete-variable 'eshell-path-env 'eshell-get-path "29.1")

I guess you mean 'eshell-host-path-env' as CURRENT-NAME.

> +(defun eshell-get-path (&optional local-part)
> +  (let* ((remote (file-remote-p default-directory))
> +         (path (cdr (eshell-get-path-assq remote t))))
> +    (when (and (eshell-under-windows-p)
> +               (not remote))
> +      (push "." path))
> +    (if (and remote (not local-part))
> +        (mapcar (lambda (x) (concat remote x)) path)

Why not file-name-concat?

Otherwise, I'd say let's install the patch, and see how it goes. There
isn't too much time left until the feature freeze in November.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 01 Oct 2022 22:03:02 GMT) Full text and rfc822 format available.

Message #37 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org, coltonlewis <at> google.com
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 1 Oct 2022 15:02:04 -0700
On 10/1/2022 1:25 PM, Michael Albinus wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
> I didn't install your patches, but I gave them a cursory review.

Thanks for taking a look.

>>    set ENV_VAR value
>>    set #'lisp-var value
> 
> Well, in Elisp the #'symbol read syntax is used for function names, see
> (info "(elisp) Special Read Syntax")
> 
> So it is surprising to see it used for variable names.

Yeah, it took me quite a while to realize that Eshell's meaning of 
#'symbol is different from Elisp's. I recently added some documentation 
in the Eshell manual to (hopefully) clarify the potential confusion.

>> Patch #4: Make $PATH a variable alias
>> ----------------------------------------
>>
>> This stores the $PATH in an alist indexed by host, similar to
>> 'grep-host-defaults-alist'. For consistency, it now derives its value
>> from '(exec-path)' everywhere (formerly, it used '(getenv "PATH") for
>> local hosts and '(exec-path)' for Tramp).
> 
> Again, no possibility to use connection-local variables? You use them
> already by calling (path-separator) ...

I'll take a look at doing that. As I understand it, connection-local 
variables are cleared if the associated connection gets cleaned up, 
right? I wonder if that would be the right thing to do. For example, if 
I cd into a remote host in Eshell, then update Eshell's $PATH for that 
host, then clean up the connection, should the $PATH be reset to the 
default for that host? I'm really not sure...

>> -(defun eshell-get-path ()
>> +(make-obsolete-variable 'eshell-path-env 'eshell-get-path "29.1")
> 
> I guess you mean 'eshell-host-path-env' as CURRENT-NAME.

I wanted to say, "Instead of using the variable 'eshell-path-env', call 
the function 'eshell-get-path'." Maybe that's not the right way to 
indicate that though.

>> +(defun eshell-get-path (&optional local-part)
>> +  (let* ((remote (file-remote-p default-directory))
>> +         (path (cdr (eshell-get-path-assq remote t))))
>> +    (when (and (eshell-under-windows-p)
>> +               (not remote))
>> +      (push "." path))
>> +    (if (and remote (not local-part))
>> +        (mapcar (lambda (x) (concat remote x)) path)
> 
> Why not file-name-concat?

Good point. I'd forgotten to update that when copying that bit out of 
'eshell-parse-colon-path'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 02 Oct 2022 05:35:02 GMT) Full text and rfc822 format available.

Message #40 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: coltonlewis <at> google.com, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 1 Oct 2022 22:34:50 -0700
On 10/1/2022 3:02 PM, Jim Porter wrote:
> On 10/1/2022 1:25 PM, Michael Albinus wrote:
>> Again, no possibility to use connection-local variables? You use them
>> already by calling (path-separator) ...
> 
> I'll take a look at doing that. As I understand it, connection-local 
> variables are cleared if the associated connection gets cleaned up, 
> right? I wonder if that would be the right thing to do. For example, if 
> I cd into a remote host in Eshell, then update Eshell's $PATH for that 
> host, then clean up the connection, should the $PATH be reset to the 
> default for that host? I'm really not sure...

After a bit of trying, I wasn't able to get this to work. I was doing 
something along these lines:

  (defvar-local eshell-path-env-list nil)

  (connection-local-set-profile-variables
   'eshell-connection-local-profile
   '((eshell-path-env-list . nil)))

  (connection-local-set-profiles
   nil 'eshell-connection-local-profile)

  ;; When getting the $PATH...
  (with-connection-local-variables
   (or eshell-path-env-list
       (setq eshell-path-env-list (butlast (exec-path)))))

However, the next time I try to get the $PATH in the 
'with-connection-local-variables' block, the value is nil again, so it 
gets recomputed. I guess 'setq' inside 'with-connection-local-variables' 
doesn't work?

This is also made more complex by the fact that in an Eshell subcommand, 
we want to be able to modify the $PATH locally so that it's reset to the 
previous value after the subcommand. Since there are so many different 
things that can alter the $PATH value, making it connection-local seemed 
to be more complex in my experiments. The alist implementation is a bit 
more primitive, but I found it easier to reason through the logic. That 
could just be because I don't quite understand all the details of 
connection-local variables though.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 02 Oct 2022 08:50:01 GMT) Full text and rfc822 format available.

Message #43 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: coltonlewis <at> google.com, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 02 Oct 2022 10:48:58 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> On 10/1/2022 3:02 PM, Jim Porter wrote:
>> On 10/1/2022 1:25 PM, Michael Albinus wrote:
>>> Again, no possibility to use connection-local variables? You use them
>>> already by calling (path-separator) ...
>> I'll take a look at doing that. As I understand it, connection-local
>> variables are cleared if the associated connection gets cleaned up,
>> right? I wonder if that would be the right thing to do. For example,
>> if I cd into a remote host in Eshell, then update Eshell's $PATH for
>> that host, then clean up the connection, should the $PATH be reset
>> to the default for that host? I'm really not sure...
>
> After a bit of trying, I wasn't able to get this to work. I was doing
> something along these lines:
>
>   (defvar-local eshell-path-env-list nil)
>
>   (connection-local-set-profile-variables
>    'eshell-connection-local-profile
>    '((eshell-path-env-list . nil)))
>
>   (connection-local-set-profiles
>    nil 'eshell-connection-local-profile)
>
>   ;; When getting the $PATH...
>   (with-connection-local-variables
>    (or eshell-path-env-list
>        (setq eshell-path-env-list (butlast (exec-path)))))
>
> However, the next time I try to get the $PATH in the
> 'with-connection-local-variables' block, the value is nil again, so it
> gets recomputed. I guess 'setq' inside
> 'with-connection-local-variables' doesn't work?

Yes. with-connection-local-variables is designed to provide those
variables inside the BODY only. And you have used nil as CRITERIA in
connection-local-set-profiles, which means you get the same variables
for every kind of default-directory, which means you don't use
connection-local variables at all :-)

What you need is a permanent setting of variables. Something like

(connection-local-set-profiles
 (connection-local-criteria-for-default-directory 'eshell)
 'eshell-connection-local-profile)

(let ((enable-connection-local-variables t)
      connection-local-variables-alist) ;; I'm not sure this is needed.
  (hack-connection-local-variables-apply
   (connection-local-criteria-for-default-directory 'eshell))
  ;; The body.
  ...)

I have used `eshell' as APPLICATION, the default application would be
`tramp'. But since you care only your eshell-* variables, you could use
an own namespace I believe. Of course, you could also use `tramp' or
anything else, it's your decision.

> This is also made more complex by the fact that in an Eshell
> subcommand, we want to be able to modify the $PATH locally so that
> it's reset to the previous value after the subcommand.

In this case, you could use the with-connection-local-variables macro
indeed. Something like

(let ((connection-local-default-application 'eshell))
  (with-connection-local-variables
  ;; Some temprary modifications.
  ...)

> Since there are so many different things that can alter the $PATH
> value, making it connection-local seemed to be more complex in my
> experiments. The alist implementation is a bit more primitive, but I
> found it easier to reason through the logic. That could just be
> because I don't quite understand all the details of connection-local
> variables though.

It is more complex to set it up, indeed. (I wish we would have made it
more friendly.) But in the long term, it will be more robust I believe.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 02 Oct 2022 08:56:02 GMT) Full text and rfc822 format available.

Message #46 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org, coltonlewis <at> google.com
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 02 Oct 2022 10:55:36 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> I'll take a look at doing that. As I understand it, connection-local
> variables are cleared if the associated connection gets cleaned up,
> right? I wonder if that would be the right thing to do. For example,
> if I cd into a remote host in Eshell, then update Eshell's $PATH for
> that host, then clean up the connection, should the $PATH be reset to
> the default for that host? I'm really not sure...

Connection-local variables have their own meaning, they are not bound to
Tramp connections. Tramp is just one application using them (but perhaps
the major one).

Even using default-directory as indicator is not fixed. It happens, if
you use connection-local-criteria-for-default-directory as CRITERIA here
and there. But you can compose your own CRITERIA if you like.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 07 Oct 2022 03:20:02 GMT) Full text and rfc822 format available.

Message #49 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Thu, 6 Oct 2022 20:19:26 -0700
[Message part 1 (text/plain, inline)]
On 10/2/2022 1:48 AM, Michael Albinus wrote:
> Yes. with-connection-local-variables is designed to provide those
> variables inside the BODY only. And you have used nil as CRITERIA in
> connection-local-set-profiles, which means you get the same variables
> for every kind of default-directory, which means you don't use
> connection-local variables at all :-)
> 
> What you need is a permanent setting of variables. Something like
> 
> (connection-local-set-profiles
>   (connection-local-criteria-for-default-directory 'eshell)
>   'eshell-connection-local-profile)
> 
> (let ((enable-connection-local-variables t)
>        connection-local-variables-alist) ;; I'm not sure this is needed.
>    (hack-connection-local-variables-apply
>     (connection-local-criteria-for-default-directory 'eshell))
>    ;; The body.
>    ...)

Hmm, I've tried this a few different ways, and I haven't been able to 
get it to work the way it should. Maybe I'm just missing something?

Attached is a minimal test case I've extracted to show the issue I'm 
having. It seems the problem is that, while I can update the path in 
'eshell-set-path' with no problem, when I call 'eshell-get-path' again, 
'hack-connection-local-variables-apply' resets 'eshell-path-env-list' to 
nil, so the modified path is lost.

Do you have any ideas about what I'm doing wrong? Or maybe 
connection-local variables aren't supposed to be used this way. All the 
documentation I see on them involves setting variables to constant 
values, not updating them in-place over the life of a program.
[connection-local.el (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 07 Oct 2022 18:30:02 GMT) Full text and rfc822 format available.

Message #52 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Fri, 07 Oct 2022 20:28:56 +0200
[Message part 1 (text/plain, inline)]
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

Thanks your the example file, it is a pleasure to work on something like this!

> Hmm, I've tried this a few different ways, and I haven't been able to
> get it to work the way it should. Maybe I'm just missing something?
>
> Attached is a minimal test case I've extracted to show the issue I'm
> having. It seems the problem is that, while I can update the path in
> 'eshell-set-path' with no problem, when I call 'eshell-get-path'
> again, 'hack-connection-local-variables-apply' resets
> 'eshell-path-env-list' to nil, so the modified path is lost.
>
> Do you have any ideas about what I'm doing wrong? Or maybe
> connection-local variables aren't supposed to be used this way. All
> the documentation I see on them involves setting variables to constant
> values, not updating them in-place over the life of a program.

Well, your example code has some problems:

- connection-local-criteria-for-default-directory returns nil for a
  local default directory. In order to handle this case, I have added
  eshell-connection-local-criteria-for-default-directory.

- You cannot use the same profile for different criteria, unless you
  intend the same settings. Therefore, I have added
  eshell-connection-local-profile.

- If you change settings in eshell-get-path or eshell-set-path, you must
  tell this to the connection-local variables machinery. I've extended
  both functions accordingly.

Now your ert test passes for me. Changed connection-local.el added.

Best regards, Michael.

[connection-local.el (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 08 Oct 2022 22:10:02 GMT) Full text and rfc822 format available.

Message #55 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 8 Oct 2022 15:09:13 -0700
[Message part 1 (text/plain, inline)]
On 10/7/2022 11:28 AM, Michael Albinus wrote:
> Now your ert test passes for me. Changed connection-local.el added.

Thanks, this makes connection-local variables a lot clearer to me. Since 
this seems pretty tricky to get right for people who don't know much 
about connection-local variables, maybe it would make sense to add some 
helper functions for anyone who wants to do something similar?

I attached an updated version of my connection-local.el that tries to 
pull out the additions you made into some helpers. What do you think?
[connection-local.el (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 09 Oct 2022 18:02:01 GMT) Full text and rfc822 format available.

Message #58 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 09 Oct 2022 20:01:10 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> Thanks, this makes connection-local variables a lot clearer to
> me. Since this seems pretty tricky to get right for people who don't
> know much about connection-local variables, maybe it would make sense
> to add some helper functions for anyone who wants to do something
> similar?
>
> I attached an updated version of my connection-local.el that tries to
> pull out the additions you made into some helpers. What do you think?

I gave it a short reading, and in general it looks OK (comments
below). Do you want to provide a patch for files-x.el with this?

This patch shall also extent the "Connection Local Variables" section of
the Elisp manual. This section is already quite
long (~150 lines), and speaks almost about static setting of
connection-local variables. You bring dynamic settings here, maybe a
subsection would help to structure. And feel free to restructure the
other, long text if you believe it would help.

Add an example.

Btw, do you have write access to the Emacs git repo? If not I recommend
to ask the maintainers (Eli or Lars) for this.

> (defun connection-local-profile-name ()
>   "Get a connection-local profile name.
>
> This allows `connection-local-setq' to use this profile name when
> setting variables connection-locally. In theory, a user of these
> functions could locally override this function if they wanted to
> change the naming scheme."

The profile name is derived from default-directory, I would make this
more obvious in the function name and the docstring.

>   (when connection-local-criteria
>     (intern (concat
>              "auto-connection-local-profile/"
>              (symbol-name (plist-get connection-local-criteria :application))
>              "/" (or (file-remote-p default-directory) "local")))))

It is not guaranteed that the :application property exists. See the
docstring of connection-local-criteria-alist: "All properties are
optional ...".

> (defun with-connection-local-application-variables-1 (application body-fun)
>   "Apply connection-local variables for APPLICATION in `default-directory'.
> Call BODY-FUN with no args, and then unwind connection-local variables."

Please say that APPLICATION must be a symbol, and shouldn't be nil (if
this is what you want).

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Mon, 10 Oct 2022 09:17:02 GMT) Full text and rfc822 format available.

Message #61 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Mon, 10 Oct 2022 11:15:53 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

Thinking about, I believe the following would suffice (untested):

--8<---------------cut here---------------start------------->8---
(defmacro with-connection-local-application-variables (application &rest body)
  "Apply connection-local variables for APPLICATION in `default-directory'.
Execute BODY, and unwind connection-local variables.

This is just `with-connection-local-variables', plus the ability
to set an application."
  (declare (debug t) (indent 1))
  `(let ((connection-local-default-application ,application))
    (with-connection-local-variables-1 (lambda () ,@body))))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Thu, 13 Oct 2022 04:12:02 GMT) Full text and rfc822 format available.

Message #64 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Wed, 12 Oct 2022 21:11:47 -0700
[Message part 1 (text/plain, inline)]
On 10/9/2022 11:01 AM, Michael Albinus wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
>> I attached an updated version of my connection-local.el that tries to
>> pull out the additions you made into some helpers. What do you think?
> 
> I gave it a short reading, and in general it looks OK (comments
> below). Do you want to provide a patch for files-x.el with this?

Thanks for taking a look. I've added a separate patch (0002 in this 
series) for adding these functions (with some improvements over the 
little test script we worked on) to files-x.el. (Patch 0001 just fixes 
an issue in the docs/tests where the :application had an extra quote.)

If you think it would be easier to track, I could file a new bug and put 
patches 0001 and 0002 in there, then come back to this bug once that's 
merged. Either way is fine by me.

The other patches in this series are mostly-unchanged from before, 
except for 0006, which now uses the new 'setq-connection-local' macro.

> This patch shall also extent the "Connection Local Variables" section of
> the Elisp manual. This section is already quite
> long (~150 lines), and speaks almost about static setting of
> connection-local variables. You bring dynamic settings here, maybe a
> subsection would help to structure. And feel free to restructure the
> other, long text if you believe it would help.

I added all this to the manual (with an example), and divided the 
Connection Local Variables section into two subsections: one for how to 
initialize profiles and set criteria for them, and another for applying 
the variables. I put the 'setq-connection-local' docs in the second 
section, since it's closely related to 'with-connection-local-variables'.

> Btw, do you have write access to the Emacs git repo? If not I recommend
> to ask the maintainers (Eli or Lars) for this.

I do have commit access to the git repo now, so I'll be able to merge 
these patches on my own once they look good.
[0001-Remove-over-quoting-of-application-values-in-connect.patch (text/plain, attachment)]
[0002-Add-helpers-to-dynamically-assign-connection-local-v.patch (text/plain, attachment)]
[0003-Allow-ignoring-errors-when-calling-eshell-match-comm.patch (text/plain, attachment)]
[0004-Obsolete-eshell-define.patch (text/plain, attachment)]
[0005-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch (text/plain, attachment)]
[0006-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch (text/plain, attachment)]
[0007-Print-the-correct-PATH-when-Eshell-s-which-fails-to-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Thu, 13 Oct 2022 06:36:02 GMT) Full text and rfc822 format available.

Message #67 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1;
 Eshell not finding executables in PATH when tramp-integration loaded
Date: Thu, 13 Oct 2022 09:35:55 +0300
> Cc: 57556 <at> debbugs.gnu.org
> Date: Wed, 12 Oct 2022 21:11:47 -0700
> From: Jim Porter <jporterbugs <at> gmail.com>
> 
> On 10/9/2022 11:01 AM, Michael Albinus wrote:
> > Jim Porter <jporterbugs <at> gmail.com> writes:
> > 
> >> I attached an updated version of my connection-local.el that tries to
> >> pull out the additions you made into some helpers. What do you think?
> > 
> > I gave it a short reading, and in general it looks OK (comments
> > below). Do you want to provide a patch for files-x.el with this?
> 
> Thanks for taking a look. I've added a separate patch (0002 in this 
> series) for adding these functions (with some improvements over the 
> little test script we worked on) to files-x.el. (Patch 0001 just fixes 
> an issue in the docs/tests where the :application had an extra quote.)
> 
> If you think it would be easier to track, I could file a new bug and put 
> patches 0001 and 0002 in there, then come back to this bug once that's 
> merged. Either way is fine by me.
> 
> The other patches in this series are mostly-unchanged from before, 
> except for 0006, which now uses the new 'setq-connection-local' macro.
> 
> > This patch shall also extent the "Connection Local Variables" section of
> > the Elisp manual. This section is already quite
> > long (~150 lines), and speaks almost about static setting of
> > connection-local variables. You bring dynamic settings here, maybe a
> > subsection would help to structure. And feel free to restructure the
> > other, long text if you believe it would help.
> 
> I added all this to the manual (with an example), and divided the 
> Connection Local Variables section into two subsections: one for how to 
> initialize profiles and set criteria for them, and another for applying 
> the variables. I put the 'setq-connection-local' docs in the second 
> section, since it's closely related to 'with-connection-local-variables'.

Thanks.  Some general documentation-related comments below.

> +@node Connection Local Profiles
> +@subsection Connection Local Profiles

It is generally a good idea to have a @cindex entry for the main topic
of a section/subsection.  Usually, the @cindex entry is just the node
or section name, with all of its words down-cases.  For example, here
I'd use

  @cindex connect local profiles

And similarly for the other subsection you added.

My other general comment is to never miss an opportunity of adding a
cross-reference when you reference a term or a symbol described
elsewhere in the documentation.  Never assume the reader already knows
what all the stuff you reference is about.  For example:

> +You can set variables in a few different ways.  To set a Lisp
> +variable, you can use the command @samp{setq @var{name} @var{value}},
> +which works much like its Lisp counterpart.

This will benefit from a cross-reference to where 'setq' is described
in the ELisp reference manual.

Please review the documentation changes for more cross-reference
opportunities like this one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 14 Oct 2022 01:30:02 GMT) Full text and rfc822 format available.

Message #70 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Thu, 13 Oct 2022 18:29:23 -0700
[Message part 1 (text/plain, inline)]
Thanks for taking a look.

On 10/12/2022 11:35 PM, Eli Zaretskii wrote:
> It is generally a good idea to have a @cindex entry for the main topic
> of a section/subsection.  Usually, the @cindex entry is just the node
> or section name, with all of its words down-cases.

Done (for both subsections).

> My other general comment is to never miss an opportunity of adding a
> cross-reference when you reference a term or a symbol described
> elsewhere in the documentation.  Never assume the reader already knows
> what all the stuff you reference is about.  For example:
[snip]
> This will benefit from a cross-reference to where 'setq' is described
> in the ELisp reference manual.

Thanks, added a cross-reference here.

> Please review the documentation changes for more cross-reference
> opportunities like this one.

I also added cross-references to the Remote Files section of the Emacs 
manual, plus to the section on let-binding. Those seemed like the most 
useful ones to me, although maybe there are some others I missed.

I attached an updated version of patch 0002 with the manual changes (the 
others are unchanged).
[0002-Add-helpers-to-dynamically-assign-connection-local-v.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 14 Oct 2022 06:18:01 GMT) Full text and rfc822 format available.

Message #73 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Fri, 14 Oct 2022 09:17:31 +0300
> Date: Thu, 13 Oct 2022 18:29:23 -0700
> Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
> From: Jim Porter <jporterbugs <at> gmail.com>
> 
> I attached an updated version of patch 0002 with the manual changes (the 
> others are unchanged).

Thanks, LGTM.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 14 Oct 2022 12:28:02 GMT) Full text and rfc822 format available.

Message #76 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Fri, 14 Oct 2022 14:27:48 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

All patches look OK to me (patch 0002 in the newer version). Just two
minor nits:

> [6. text/plain; 0005-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch]
>
> +You can set variables in a few different ways.  To set a Lisp
> +variable, you can use the command @samp{setq @var{name} @var{value}},
> +which works much like its Lisp counterpart.  To set an environment
> +variable, use @samp{export @var{NAME}=@var{value}}. You can also use
> +@samp{set @var{name} @var{value}}, which sets a Lisp variable if
> +@var{name} is a symbol, or an environment variable if @var{name} is a
> +string.  Finally, you can temporarily set environment variables for a
> +single command with @samp{@var{NAME}=@var{value} @var{command}
> +@dots{}}. This is equivalent to:
> +
> +@example
> +@{
> +  set @var{NAME} @var{value}
> +  @var{command} @dots{}
> +@}
> +@end example

@var{} produces already capital letters, so you are more consistent with
@var{name}.

> [7. text/plain; 0006-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch]
>
> +@vindex $PATH
> +@item $PATH
> +This specifies the directories to search for executable programs as a
> +string, separated by @code{":"} for Unix and GNU systems, and
> +@code{";"} for MS systems.  This variable is connection-aware, so when
> +the current directory on a remote host, it will automatically update
> +to reflect the search path on that host.

"... when the current directory is on a remote host ..."

Perhaps you could also say, that when the current directory changes back
to the local host, $PATH is also updated respectively.

Best reegards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 14 Oct 2022 12:29:02 GMT) Full text and rfc822 format available.

Message #79 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Fri, 14 Oct 2022 14:28:41 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> I attached an updated version of patch 0002 with the manual changes
> (the others are unchanged).

This looks OK to me. The patch for variables.texi didn't apply cleanly
in my env, but reading the diff gave me enough information.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Fri, 14 Oct 2022 20:54:02 GMT) Full text and rfc822 format available.

Message #82 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Fri, 14 Oct 2022 13:53:33 -0700
[Message part 1 (text/plain, inline)]
On 10/14/2022 5:27 AM, Michael Albinus wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
> Hi Jim,
> 
> All patches look OK to me (patch 0002 in the newer version). Just two
> minor nits:
> 
>> [6. text/plain; 0005-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch]
>>
>> +You can set variables in a few different ways.  To set a Lisp
>> +variable, you can use the command @samp{setq @var{name} @var{value}},
>> +which works much like its Lisp counterpart.  To set an environment
>> +variable, use @samp{export @var{NAME}=@var{value}}. You can also use
>> +@samp{set @var{name} @var{value}}, which sets a Lisp variable if
>> +@var{name} is a symbol, or an environment variable if @var{name} is a
>> +string.  Finally, you can temporarily set environment variables for a
>> +single command with @samp{@var{NAME}=@var{value} @var{command}
>> +@dots{}}. This is equivalent to:
>> +
>> +@example
>> +@{
>> +  set @var{NAME} @var{value}
>> +  @var{command} @dots{}
>> +@}
>> +@end example
> 
> @var{} produces already capital letters, so you are more consistent with
> @var{name}.

My intent was to make that display as all-caps in the HTML documentation 
as well. In that excerpt, 'NAME' should always be an environment 
variable, so I used the capitalization conventions that env vars usually 
use. 'name', on the other hand, could be a Lisp variable or an env var.

I adjusted these docs a bit since they seemed unclear to me on a second 
reading (see attached), but kept the all-caps NAME for env vars. If you 
still think that's wrong, I'll change it to lower-case before merging.

>> [7. text/plain; 0006-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch]
>>
>> +@vindex $PATH
>> +@item $PATH
>> +This specifies the directories to search for executable programs as a
>> +string, separated by @code{":"} for Unix and GNU systems, and
>> +@code{";"} for MS systems.  This variable is connection-aware, so when
>> +the current directory on a remote host, it will automatically update
>> +to reflect the search path on that host.
> 
> "... when the current directory is on a remote host ..."
> 
> Perhaps you could also say, that when the current directory changes back
> to the local host, $PATH is also updated respectively.

I reworked this to make it clearer that the value is updated *every* 
time you 'cd' into a different host (including from one remote host to 
another) and also added a cross-reference to the Remote Files section of 
the Emacs manual.
[0005-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch (text/plain, attachment)]
[0006-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 15 Oct 2022 10:39:01 GMT) Full text and rfc822 format available.

Message #85 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 15 Oct 2022 12:38:05 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

>> @var{} produces already capital letters, so you are more consistent
>> with
>> @var{name}.
>
> My intent was to make that display as all-caps in the HTML
> documentation as well. In that excerpt, 'NAME' should always be an
> environment variable, so I used the capitalization conventions that
> env vars usually use. 'name', on the other hand, could be a Lisp
> variable or an env var.

You use @var{} by side-effect6, which is always problematic. For
example, RMS is looking for a replacement of the texinfo syntax for
documentation, org syntax is a candidate. But whatever is chosen, an
automatic conversion from .texinfo to .<whatever> could be problematic
then.

Use what is offered by texinfo. Say for example

--8<---------------cut here---------------start------------->8---
the @env{PATH} environment variable
--8<---------------cut here---------------end--------------->8---

And in sample code, do not apply further formatting, but say it as you
mean it

--8<---------------cut here---------------start------------->8---
@samp{setq name value}
@samp{export NAME=value}
--8<---------------cut here---------------end--------------->8---

> I adjusted these docs a bit since they seemed unclear to me on a
> second reading (see attached), but kept the all-caps NAME for env
> vars. If you still think that's wrong, I'll change it to lower-case
> before merging.

Otherwise, it LGTM. Somewhere there is only one space after a dot
(should be two spaces), but I didn't marked this during review, and now
I'm too lazy to look for :-)

I'd say just push it to the repo, and if there's something left to do we
can stiil do it.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sat, 15 Oct 2022 23:34:02 GMT) Full text and rfc822 format available.

Message #88 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sat, 15 Oct 2022 16:33:44 -0700
[Message part 1 (text/plain, inline)]
On 10/15/2022 3:38 AM, Michael Albinus wrote:
> Use what is offered by texinfo. Say for example
> 
> --8<---------------cut here---------------start------------->8---
> the @env{PATH} environment variable
> --8<---------------cut here---------------end--------------->8---

Ah ha, got it.

> And in sample code, do not apply further formatting, but say it as you
> mean it
> 
> --8<---------------cut here---------------start------------->8---
> @samp{setq name value}
> @samp{export NAME=value}
> --8<---------------cut here---------------end--------------->8---

The Texinfo manual says I should wrap metasyntactic variables though[1]:

    For example,

        To delete file @var{filename},
        type @samp{rm @var{filename}}.

    produces

        To delete file filename, type ‘rm filename’.

    (Note that @var may appear inside @code, @samp, @file, etc.)


> Otherwise, it LGTM. Somewhere there is only one space after a dot
> (should be two spaces), but I didn't marked this during review, and now
> I'm too lazy to look for :-)

I think I found it. Fixed.

> I'd say just push it to the repo, and if there's something left to do we
> can stiil do it.

There's one significant problem I noticed with patch 0002 that we should 
probably fix first: 'setq-connection-local' clears all connection-local 
variables for the profile that were set elsewhere. That is, this:

    (with-connection-local-variables
     (setq-connection-local foo "foo")
     (setq-connection-local bar "bar"))

only sets 'bar' on the connection-local profile; the second 
'setq-connection-local' clears 'foo'. Attached is a fix for this (I'll 
fold it into patch 0002 before merging). I'm not sure if the new 
'connection-local-update-profile-variables' I added is 100% perfect, but 
I think it should work for more real-world situations.

[1] 
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/_0040var.html
[connection-local-update-profile-variables.diff (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 16 Oct 2022 17:01:02 GMT) Full text and rfc822 format available.

Message #91 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 16 Oct 2022 19:00:22 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> There's one significant problem I noticed with patch 0002 that we
> should probably fix first: 'setq-connection-local' clears all
> connection-local variables for the profile that were set
> elsewhere. That is, this:
>
>     (with-connection-local-variables
>      (setq-connection-local foo "foo")
>      (setq-connection-local bar "bar"))
>
> only sets 'bar' on the connection-local profile; the second
> 'setq-connection-local' clears 'foo'. Attached is a fix for this (I'll
> fold it into patch 0002 before merging). I'm not sure if the new
> 'connection-local-update-profile-variables' I added is 100% perfect,
> but I think it should work for more real-world situations.

I see. Yes, connection-local-update-profile-variables should do
better. But I don't understand why its implementation doesn't use the
existing connection-local-get-profile-variables.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 16 Oct 2022 20:52:02 GMT) Full text and rfc822 format available.

Message #94 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1;
 Eshell not finding executables in PATH when tramp-integration loaded
Date: Sun, 16 Oct 2022 16:51:28 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > My intent was to make that display as all-caps in the HTML documentation 
  > as well. In that excerpt, 'NAME' should always be an environment 
  > variable, so I used the capitalization conventions that env vars usually 
  > use. 'name', on the other hand, could be a Lisp variable or an env var.

It should be @var{name} to express that it is a metasyntactic variable
that stands for something called ``name''.

It is true that that the name it stands for will be the name of an
environment variable, but that is a secondary fact about it.  The most
crucial fact about this metasyntactic variable is that it is a
metasyntactic variable.  So we should format it like metasyntactic
variables, which is what @var does.

In formats which allow distinctions of type face, we should indicate this
with italics, and the metasyntactic variable name should be in lower case.
-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 16 Oct 2022 23:03:01 GMT) Full text and rfc822 format available.

Message #97 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 16 Oct 2022 16:01:56 -0700
On 10/16/2022 10:00 AM, Michael Albinus wrote:
> I see. Yes, connection-local-update-profile-variables should do
> better. But I don't understand why its implementation doesn't use the
> existing connection-local-get-profile-variables.

Just forgetfulness on my part. :)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Sun, 16 Oct 2022 23:08:01 GMT) Full text and rfc822 format available.

Message #100 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: rms <at> gnu.org
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Sun, 16 Oct 2022 16:07:42 -0700
[Message part 1 (text/plain, inline)]
On 10/16/2022 1:51 PM, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>    > My intent was to make that display as all-caps in the HTML documentation
>    > as well. In that excerpt, 'NAME' should always be an environment
>    > variable, so I used the capitalization conventions that env vars usually
>    > use. 'name', on the other hand, could be a Lisp variable or an env var.
> 
> It should be @var{name} to express that it is a metasyntactic variable
> that stands for something called ``name''.

Thanks. I've fixed my changes in the Eshell manual to use this 
convention now, and also added some further cross-references.

I've attached (hopefully) the final version of these patches, which I'll 
merge in the next day or so, unless someone finds any other issues.
[0001-Remove-over-quoting-of-application-values-in-connect.patch (text/plain, attachment)]
[0002-Add-helpers-to-dynamically-assign-connection-local-v.patch (text/plain, attachment)]
[0003-Allow-ignoring-errors-when-calling-eshell-match-comm.patch (text/plain, attachment)]
[0004-Obsolete-eshell-define.patch (text/plain, attachment)]
[0005-Allow-setting-the-values-of-variable-aliases-in-Eshe.patch (text/plain, attachment)]
[0006-Improve-handling-of-PATH-in-Eshell-for-remote-direct.patch (text/plain, attachment)]
[0007-Print-the-correct-PATH-when-Eshell-s-which-fails-to-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57556; Package emacs. (Tue, 18 Oct 2022 01:52:01 GMT) Full text and rfc822 format available.

Message #103 received at 57556 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: rms <at> gnu.org
Cc: michael.albinus <at> gmx.de, 57556 <at> debbugs.gnu.org
Subject: Re: bug#57556: 28.1; Eshell not finding executables in PATH when
 tramp-integration loaded
Date: Mon, 17 Oct 2022 18:51:40 -0700
On 10/16/2022 4:07 PM, Jim Porter wrote:
> I've attached (hopefully) the final version of these patches, which I'll 
> merge in the next day or so, unless someone finds any other issues.

Merged as fd4992d356a9c4225cb518a6a5309aaa1d0f640b. I also included a 
small fix to 'eshell-get-path' to fix a failure on MS-Windows systems.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Nov 2022 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.