Subject: Re: bug#35241: 27.0.50; Tramp can't decrypt .authinfo.gpg in Win 10

From: Michael Albinus <[email-masked]>
Date: Tue, 16 Apr 2019 18:20:24 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Albinus <[email-masked]>
>> Date: Tue, 16 Apr 2019 14:50:40 +0200
>> Cc: [email-masked], Noam Postavsky <[email-masked]>
>>
>> Relative file names are not forbidden as part of exec-path. Shall we ban
>> them (with an error message)? Or shall we ignore them, silently? Don't know.
>>
>> I'd vote for the latter (including proper documentation).
>
> Maybe executable-find should ignore them if default-directory is
> remote?

Or suppress file name handlers if the REMOTE arg is nil? Like

--8<---------------cut here---------------start------------->8---
*** /tmp/ediffaHi4iI	2019-04-16 18:15:36.467002896 +0200
--- /home/albinus/src/emacs/lisp/files.el	2019-04-16 18:15:25.698810831 +0200
***************
*** 1058,1064 ****
          (when (stringp res) (file-local-name res)))
      ;; Use 1 rather than file-executable-p to better match the
      ;; behavior of call-process.
!     (locate-file command exec-path exec-suffixes 1)))

  (defun load-library (library)
    "Load the Emacs Lisp library named LIBRARY.
--- 1058,1065 ----
          (when (stringp res) (file-local-name res)))
      ;; Use 1 rather than file-executable-p to better match the
      ;; behavior of call-process.
!     (let (file-name-handler)
!       (locate-file command exec-path exec-suffixes 1))))

  (defun load-library (library)
    "Load the Emacs Lisp library named LIBRARY.
--8<---------------cut here---------------end--------------->8---

Alternatively, we could just suppress Tramp:

--8<---------------cut here---------------start------------->8---
*** /tmp/ediffaHi4iI	2019-04-16 18:15:36.467002896 +0200
--- /home/albinus/src/emacs/lisp/files.el	2019-04-16 18:15:25.698810831 +0200
***************
*** 1058,1064 ****
          (when (stringp res) (file-local-name res)))
      ;; Use 1 rather than file-executable-p to better match the
      ;; behavior of call-process.
!     (locate-file command exec-path exec-suffixes 1)))

  (defun load-library (library)
    "Load the Emacs Lisp library named LIBRARY.
--- 1058,1065 ----
          (when (stringp res) (file-local-name res)))
      ;; Use 1 rather than file-executable-p to better match the
      ;; behavior of call-process.
!     (let (tramp-mode)
!       (locate-file command exec-path exec-suffixes 1))))

  (defun load-library (library)
    "Load the Emacs Lisp library named LIBRARY.
--8<---------------cut here---------------end--------------->8---

But in this case, other remote default directories would do the same
harm. Think about `url-handler-mode', for example.

Best regards, Michael.