Subject: bug#58270: 29.0.50; vc-tor/TRAMP issue

From: Philip Kaludercic <[email-masked]>
Date: Mon, 03 Oct 2022 12:29:14 +0000

If connecting to a remote server and accessing a file under version
control, this error message appears if "torsocks" is not installed:

         env: ‘torsocks’: No such file or directory

I guess this patch would fix the issue:

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index dc3ed52650..4348e42722 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -346,7 +346,7 @@ vc-do-command
         (vc-setup-buffer buffer))
       (cl-destructuring-bind (command file-or-list flags)
           (funcall vc-filter-command-function command file-or-list flags)
-        (when vc-tor
+        (when (and vc-tor (executable-find "torsocks"))
           (push command flags)
           (setq command "torsocks"))
         (let* (;; FIXME: file-relative-name can return a bogus result

but then a user could be deceived into thinking that VC is using tor
even if it actually isn't the case.  Perhaps adding a warning would be
enough?  Or could vc-tor be given an option to only activate if
possible?

I also have the interesting case that I was accessing a file version
controlled under RCS, so no network communication was going to be
necessary in the first place.

In GNU Emacs 29.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.17.6) of 2022-09-30 built on rhea
Repository revision: 7c455f41186f1acbd8c68fec39fc4d3f5fa7bc60
Repository branch: local
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --with-pgtk --with-imagemagick'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK
JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER
PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS XIM
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:
  outline-minor-mode: t
  flymake-mode: t
  yas-minor-mode: t
  flyspell-mode: t
  repeat-mode: t
  display-battery-mode: t
  display-time-mode: t
  diff-hl-flydiff-mode: t
  diff-hl-mode: t
  winner-mode: t
  windmove-mode: t
  corfu-history-mode: t
  corfu-mode: t
  vertico-multiform-mode: t
  vertico-mode: t
  electric-pair-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  save-place-mode: t
  savehist-mode: t
  pixel-scroll-precision-mode: t
  pixel-scroll-mode: t
  xterm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  size-indication-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/philip/.config/emacs/site-lisp/flymake-proselint/flymake-proselint hides /home/philip/.config/emacs/elpa/flymake-proselint-0.3.0/flymake-proselint
/home/philip/.config/emacs/site-lisp/emacs-inspector/inspector hides /home/philip/.config/emacs/elpa/inspector-0.8/inspector
/home/philip/.config/emacs/site-lisp/emacs-inspector/inspector-tests hides /home/philip/.config/emacs/elpa/inspector-0.8/inspector-tests
/home/philip/.config/emacs/site-lisp/rcirc-color/rcirc-color hides /home/philip/.config/emacs/elpa/rcirc-color-0.4.3/rcirc-color
/home/philip/.config/emacs/elpa/transient-0.3.7/transient hides /home/philip/Source/emacs/lisp/transient

Features:
(shadow sort autocrypt-message autocrypt ecomplete mail-extr gnus-msg
gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum
gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail
mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win emacsbug
message rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
find-func orderless vertico-directory vertico-flat vc-filewise grep
char-fold misearch multi-isearch vc-fossil vc-src vc-sccs vc-svn vc-cvs
vc-rcs vc-hg vc-bzr copyright vc-backup vc-git flymake-proselint
yank-media mhtml-mode css-mode smie eww xdg url-queue shr pixel-fill
kinsoku url-file svg puny mm-url color js imenu cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
sgml-mode facemenu dom dired-aux gnus-dired buffer-env compat noutline
outline so-long derived checkdoc flymake-proc flymake warnings
yasnippet-snippets cl-extra yasnippet flyspell ispell auth-source-pass
repeat project battery dbus xml shell-command+ thingatpt dired-x time
sendmail rfc2047 rfc2045 ietf-drums gnus nnheader gnus-util mail-utils
range mm-util mail-prsvr finder-inf diff-hl-flydiff diff diff-hl
log-view pcvs-util vc-dir ewoc vc dired dired-loaddefs vc-dispatcher
diff-mode easy-mmode hippie-exp winner windmove corfu-history corfu
vertico-multiform vertico elec-pair tramp-cache time-stamp tramp-sh
tramp tramp-loaddefs trampver tramp-integration cus-edit pp icons
files-x tramp-compat rx shell pcomplete parse-time iso8601 time-date
ls-lisp format-spec recentf tree-widget wid-edit saveplace savehist
pixel-scroll cua-base xt-mouse modus-operandi-theme modus-themes
cus-load setup site-lisp auto-site compile text-property-search comint
osc ansi-color autoload loaddefs-gen lisp-mnt auctex-autoloads tex-site
buffer-env-autoloads consult-autoloads compat-autoloads corfu-autoloads
crdt-autoloads debbugs-autoloads diff-hl-autoloads ef-themes-autoloads
embark-autoloads flylisp-autoloads flymake-proselint-autoloads
focus-autoloads geiser-chibi-autoloads geiser-guile-autoloads
geiser-impl help-fns radix-tree help-mode geiser-custom geiser-base ring
geiser-autoloads inspector-autoloads keycast-autoloads magit-autoloads
rcirc-color-autoloads slime-autoloads transient-autoloads
vc-fossil-autoloads vertico-autoloads which-key-autoloads info package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core password-cache json subr-x
cl-macs pcase map byte-opt gv bytecomp byte-compile cconv url-vars
cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-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 nadvice seq simple cl-generic indonesian philippine
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 abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk multi-tty make-network-process emacs)

Memory information:
((conses 16 386377 117773)
 (symbols 48 29817 1)
 (strings 32 107857 4487)
 (string-bytes 1 3461241)
 (vectors 16 55033)
 (vector-slots 8 1438249 137301)
 (floats 8 436 881)
 (intervals 56 2283 0)
 (buffers 1000 27))