unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
@ 2019-12-17 12:44 Fan Yang
  2019-12-17 16:02 ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Fan Yang @ 2019-12-17 12:44 UTC (permalink / raw)
  To: 38648


Re-produce steps:

1. `find-file' to my project root directory on a remote machine,
   namely, "/scp:vm00:pmdk-balloon/".
2. `M-x compile', and give compile command "make".
3. (Previously I have injected some typos in some of my source files,
   say "obj.c").
4. In the *compilation* buffer, the "obj.c" file appears.  But when I
   click the underlined text (or <RET> on it), an error occurs in the
   minibuffer:

   "Find this error in (default obj.c): /scp:vm00:/System/Volumes/Data/home/fan/pmdk-balloon/src/libpmemobj"

   The "/System/Volumes/Data/" is actually a path on my local machine.
5. To further confirm, I use `C-u C-x =' on the underlined text in the
   *compilation* buffer.  The "compilation-message" text property shows:

   #s(compilation--message
   (nil 42
        (("../common/vec.h" "/scp:vm00:/System/Volumes/Data/home/fan/pmdk-balloon/src/libpmemobj")
         nil
         (42 #1))
        nil nil)
   0 nil)

It appears that when compile.el was handling the remote path, it
mixed-up part of my local machine path with the
remote machine path, resulting the error.

I use Edebug to instrument `compilation-get-file-structure' and
then `file-truename' to find when my local path "/System/Volumes/Data/"
is inserted, here is a backtrace:

  lines started with a "*" is what I think important.

  (file-symlink-p filename)
  (setq target (file-symlink-p filename))
  (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))
  (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/System" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/System/Volumes" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
* file-truename("/System/Volumes/Data" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
* file-truename("/home" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/home/fan" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/home/fan/pmdk-balloon" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/home/fan/pmdk-balloon/src" (91) (nil))
  (file-name-as-directory (file-truename dirfile counter prev-dirs))
  (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))
  (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))
  (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new))))
  (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory (file-truename dirfile counter prev-dirs)))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))
  (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir (car prev-dirs)))) (let ((old dir) (new (file-name-as-directory ...))) (setcar prev-dirs (cons (cons old new) (car prev-dirs))) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t))))))
  (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr (assoc dir ...))) (let ((old dir) (new ...)) (setcar prev-dirs (cons ... ...)) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory (directory-file-name dir))) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir (file-name-nondirectory filename))) (setq target (file-symlink-p filename)) (if target (setq filename (files--splice-dirname-file dir target) done nil) (setq done t)))))))
  (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or (file-name-directory filename) default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq (compare-strings dir 0 nil dirfile 0 nil t) t)) (if (assoc dir (car prev-dirs)) (setq dir (cdr ...)) (let (... ...) (setcar prev-dirs ...) (setq dir new)))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name (file-name-directory ...)) done t) (if (equal "." (file-name-nondirectory filename)) (setq filename (directory-file-name dir) done t) (setq filename (concat dir ...)) (setq target (file-symlink-p filename)) (if target (setq filename ... done nil) (setq done t))))))))
  (let (done (file-name-handler-alist (if prev-dirs file-name-handler-alist (let ((tem (copy-sequence file-name-handler-alist))) (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) (or prev-dirs (setq prev-dirs (list nil))) (if (eq system-type 'windows-nt) (if (string-match "[[*?]" filename) nil (let ((longname (w32-long-file-name filename))) (if longname (setq filename longname))))) (while (not done) (setcar counter (1- (car counter))) (if (< (car counter) 0) (error "Apparent cycle of symbolic links for %s" filename)) (let ((handler (find-file-name-handler filename 'file-truename))) (if handler (setq filename (funcall handler 'file-truename filename) done t) (let ((dir (or ... default-directory)) target dirfile) (setq dirfile (directory-file-name dir)) (or (string= dir dirfile) (and (file-name-case-insensitive-p dir) (eq ... t)) (if (assoc dir ...) (setq dir ...) (let ... ... ...))) (if (equal ".." (file-name-nondirectory filename)) (setq filename (directory-file-name ...) done t) (if (equal "." ...) (setq filename ... done t) (setq filename ...) (setq target ...) (if target ... ...))))))) filename)
  file-truename("/home/fan/pmdk-balloon/src/libpmemobj")
  (if (cdr file) (file-truename (cdr file)))
  (let ((filename (car file)) (spec-directory (if (cdr file) (file-truename (cdr file))))) (when (and (boundp 'comint-file-name-prefix) (not (equal comint-file-name-prefix ""))) (if (file-name-absolute-p filename) (setq filename (concat comint-file-name-prefix filename)) (if spec-directory (setq spec-directory (file-truename (concat comint-file-name-prefix spec-directory)))))) (unless (memq compilation-parse-errors-filename-function '(nil identity)) (save-match-data (setq filename (funcall compilation-parse-errors-filename-function filename)))) (if (stringp filename) (setq filename (command-line-normalize-file-name filename))) (puthash file (or (gethash (cons filename spec-directory) compilation-locs) (puthash (cons filename spec-directory) (compilation--make-file-struct (list filename spec-directory) fmt) compilation-locs)) compilation-locs))
  (or (gethash file compilation-locs) (let ((filename (car file)) (spec-directory (if (cdr file) (file-truename (cdr file))))) (when (and (boundp 'comint-file-name-prefix) (not (equal comint-file-name-prefix ""))) (if (file-name-absolute-p filename) (setq filename (concat comint-file-name-prefix filename)) (if spec-directory (setq spec-directory (file-truename (concat comint-file-name-prefix spec-directory)))))) (unless (memq compilation-parse-errors-filename-function '(nil identity)) (save-match-data (setq filename (funcall compilation-parse-errors-filename-function filename)))) (if (stringp filename) (setq filename (command-line-normalize-file-name filename))) (puthash file (or (gethash (cons filename spec-directory) compilation-locs) (puthash (cons filename spec-directory) (compilation--make-file-struct (list filename spec-directory) fmt) compilation-locs)) compilation-locs)))
  compilation-get-file-structure(("../common/vec.h" . "/home/fan/pmdk-balloon/src/libpmemobj") nil)
  compilation-internal-error-properties(("../common/vec.h" . "/home/fan/pmdk-balloon/src/libpmemobj") 42 nil nil nil 0 nil)
  compilation-error-properties(1 2 nil 3 nil (4 . 5) nil)
  compilation-parse-errors(1941 #<marker at 2809 in *compilation*>)
  compilation--parse-region(1941 #<marker at 2809 in *compilation*>)
  compilation--ensure-parse(2462)
  compilation-filter(#<process compilation> "In file included from ../common/vec.h:42,\n        ...")

Then I find that in my environment, `(file-symlink-p "/home")' is
evaluated to "/System/Volumes/Data/home".  Now I stuck here since I know
little about TRAMP and how a remote file path should be handled.

Do you have any suggestion or idea to fix this bug?  Thanks in advance
for your time.

Other information:

1. macOS Catalina 10.15.2
2. My emacs is at commit 9ee5af315098245d9f58eb5562dca6997cab4426, Dec 14, 2019.


In GNU Emacs 27.0.50 (build 2, x86_64-apple-darwin19.2.0, NS appkit-1894.20 Version 10.15.2 (Build 19C57))
 of 2019-12-15 built on Fans-Air.ipads-lab.se.sjtu.edu.cn
Repository revision: 9ee5af315098245d9f58eb5562dca6997cab4426
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.2

Recent messages:
Tramp: Found remote shell prompt on ‘vm00’
Tramp: Opening connection for vm00 using scp...done
Compilation exited abnormally with code 2
Mark saved where search started
Type "q" in help window to restore its previous buffer.
Char: h (104, #o150, #x68) point=1977 of 2808 (70%) column=36
mouse-2, RET: describe this character set
mouse-2, RET: show this character in its character set
mouse-2, RET: Push this button
mouse-2, RET: pretty print value in another buffer

Configured using:
 'configure --prefix=/Users/fan/src/emacs/out
 CPPFLAGS=-I/usr/local/opt/libxml2/include/libxml2/
 LDFLAGS=-L/usr/local/opt/libxml2/lib --with-ns'

Configured features:
RSVG GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
MODULES THREADS PDUMPER LCMS2 GMP

Important settings:
  value of $LC_ALL: 
  value of $LC_COLLATE: zh_CN.UTF-8
  value of $LC_CTYPE: zh_CN.UTF-8
  value of $LC_MESSAGES: zh_CN.UTF-8
  value of $LC_MONETARY: zh_CN.UTF-8
  value of $LC_NUMERIC: zh_CN.UTF-8
  value of $LC_TIME: zh_CN.UTF-8
  value of $LANG: zh_CN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils pp wid-edit descr-text help-mode easymenu
misearch multi-isearch compile dired dired-loaddefs tramp-cache tramp-sh
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
shell pcomplete comint ansi-color ring parse-time iso8601 time-date
ls-lisp format-spec auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map seq byte-opt gv bytecomp
byte-compile cconv edmacro kmacro cl-loaddefs cl-lib china-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu 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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 74466 9616)
 (symbols 48 20580 1)
 (strings 32 82411 1816)
 (string-bytes 1 2108733)
 (vectors 16 15285)
 (vector-slots 8 631222 14248)
 (floats 8 48 31)
 (intervals 56 749 0)
 (buffers 1000 18))





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

* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
  2019-12-17 12:44 bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly Fan Yang
@ 2019-12-17 16:02 ` Michael Albinus
  2019-12-18  1:52   ` Fan Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2019-12-17 16:02 UTC (permalink / raw)
  To: Fan Yang; +Cc: 38648

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

Fan Yang <Fan_Yang@sjtu.edu.cn> writes:

Hi,

> Re-produce steps:
>
> 1. `find-file' to my project root directory on a remote machine,
>    namely, "/scp:vm00:pmdk-balloon/".
> 2. `M-x compile', and give compile command "make".
> 3. (Previously I have injected some typos in some of my source files,
>    say "obj.c").
> 4. In the *compilation* buffer, the "obj.c" file appears.  But when I
>    click the underlined text (or <RET> on it), an error occurs in the
>    minibuffer:
>
>    "Find this error in (default obj.c): /scp:vm00:/System/Volumes/Data/home/fan/pmdk-balloon/src/libpmemobj"
>
>    The "/System/Volumes/Data/" is actually a path on my local machine.

> It appears that when compile.el was handling the remote path, it
> mixed-up part of my local machine path with the
> remote machine path, resulting the error.
>
> Then I find that in my environment, `(file-symlink-p "/home")' is
> evaluated to "/System/Volumes/Data/home".  Now I stuck here since I know
> little about TRAMP and how a remote file path should be handled.

Could you pls check, whether the appended patch fixes the problem?

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1300 bytes --]

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 3fbd6eb2c7..197d52b2de 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2936,21 +2936,15 @@ compilation-get-file-structure
       ;; Let's normalize it and look again.
       (let ((filename (car file))
 	    ;; Get the specified directory from FILE.
-	    (spec-directory (if (cdr file)
-				(file-truename (cdr file)))))
+	    (spec-directory
+             (if (cdr file)
+		 (file-truename (concat comint-file-name-prefix (cdr file))))))

 	;; Check for a comint-file-name-prefix and prepend it if appropriate.
 	;; (This is very useful for compilation-minor-mode in an rlogin-mode
 	;; buffer.)
-	(when (and (boundp 'comint-file-name-prefix)
-		   (not (equal comint-file-name-prefix "")))
-	  (if (file-name-absolute-p filename)
-	      (setq filename
-		    (concat comint-file-name-prefix filename))
-	    (if spec-directory
-		(setq spec-directory
-		      (file-truename
-		       (concat comint-file-name-prefix spec-directory))))))
+	(if (file-name-absolute-p filename)
+	    (setq filename (concat comint-file-name-prefix filename)))

 	;; If compilation-parse-errors-filename-function is
 	;; defined, use it to process the filename.  The result might be a

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

* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
  2019-12-17 16:02 ` Michael Albinus
@ 2019-12-18  1:52   ` Fan Yang
  2019-12-18  2:02     ` Fan Yang
  2019-12-18  9:20     ` Michael Albinus
  0 siblings, 2 replies; 6+ messages in thread
From: Fan Yang @ 2019-12-18  1:52 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 38648

2019年12月18日 00:02,Michael Albinus <michael.albinus@gmx.de> 写道:

> Could you pls check, whether the appended patch fixes the problem?

Yes!  This patch fixes this bug, thanks.

Fan




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

* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
  2019-12-18  1:52   ` Fan Yang
@ 2019-12-18  2:02     ` Fan Yang
  2019-12-18  9:21       ` Michael Albinus
  2019-12-18  9:20     ` Michael Albinus
  1 sibling, 1 reply; 6+ messages in thread
From: Fan Yang @ 2019-12-18  2:02 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 38648

Hi Michael, BTW will this patch be in upstream sooner or later? just curious

fan

2019年12月18日 09:52,Fan Yang <Fan_Yang@sjtu.edu.cn> 写道:

> 2019年12月18日 00:02,Michael Albinus <michael.albinus@gmx.de> 写道:
> 
>> Could you pls check, whether the appended patch fixes the problem?
> 
> Yes!  This patch fixes this bug, thanks.





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

* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
  2019-12-18  1:52   ` Fan Yang
  2019-12-18  2:02     ` Fan Yang
@ 2019-12-18  9:20     ` Michael Albinus
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Albinus @ 2019-12-18  9:20 UTC (permalink / raw)
  To: Fan Yang; +Cc: 38648

Fan Yang <Fan_Yang@sjtu.edu.cn> writes:

>> Could you pls check, whether the appended patch fixes the problem?
>
> Yes!  This patch fixes this bug, thanks.

Thanks for checking.

> Fan

Best regards, Michael.





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

* bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly
  2019-12-18  2:02     ` Fan Yang
@ 2019-12-18  9:21       ` Michael Albinus
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Albinus @ 2019-12-18  9:21 UTC (permalink / raw)
  To: Fan Yang; +Cc: 38648

Fan Yang <Fan_Yang@sjtu.edu.cn> writes:

> Hi Michael, BTW will this patch be in upstream sooner or later? just curious

I've just committed it.

> fan

Best regards, Michael.





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

end of thread, other threads:[~2019-12-18  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-17 12:44 bug#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly Fan Yang
2019-12-17 16:02 ` Michael Albinus
2019-12-18  1:52   ` Fan Yang
2019-12-18  2:02     ` Fan Yang
2019-12-18  9:21       ` Michael Albinus
2019-12-18  9:20     ` Michael Albinus

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).