unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29267: 26.0.90; find-file confused by process-environment's HOME even with absolute fname
@ 2017-11-11 23:43 João Távora
  2017-11-12  1:29 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: João Távora @ 2017-11-11 23:43 UTC (permalink / raw)
  To: 29267, rgm

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-12 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-11 23:43 bug#29267: 26.0.90; find-file confused by process-environment's HOME even with absolute fname João Távora
2017-11-12  1:29 ` Glenn Morris
2017-11-12 12:46   ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).