GNU bug report logs - #29267
26.0.90; find-file confused by process-environment's HOME even with absolute fname

Previous Next

Package: emacs;

Reported by: joaotavora <at> gmail.com (João Távora)

Date: Sat, 11 Nov 2017 23:44:02 UTC

Severity: normal

Merged with 19657

Found in versions 25.0.50, 26.0.90

Fixed in version 24.5

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: joaotavora <at> gmail.com (João Távora)
To: bug-gnu-emacs <at> gnu.org, Glenn Morris <rgm <at> gnu.org>
Subject: 26.0.90;
 find-file confused by process-environment's HOME even with absolute
 fname
Date: Sat, 11 Nov 2017 23:43:03 +0000
Hello maintainers, Glenn,

[This popped up with Glenn's idea for a fix to bug#29187 (which I
commited in 0da08f2f8ef1946978f0974e9e8cdb87fece018c). It's breaking an
interactive run of the flymake tests (which run fine with make check).]

I find, to my surprise that evaluating this form returns nil

   (let* ((tempdir (make-temp-file "some-temp-dir" t))
          (process-environment (cons (format "HOME=%s" tempdir)
                                     process-environment))
          (absolute (concat "/home/"
           		 user-login-name
           		 "/foo.txt")))
     (string= absolute
              (with-current-buffer
                  (find-file-noselect absolute)
                buffer-file-name)))

Same with find-file. find-file is unexpectedly prepending my absolute
file name with HOME found in the process environment.

It returns t, as expected, when:

* when the process-environment override is removed;

* emacs is started with HOME=/nonexistent, as is the case with
  make check;

* very curiously, if the absolute file name is *not* prefixed by
  whatever HOME was before the override;

Thanks,
João




This bug report was last modified 7 years and 262 days ago.

Previous Next


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