all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
@ 2013-03-11  2:03 Barry OReilly
  2013-03-11 16:30 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Barry OReilly @ 2013-03-11  2:03 UTC (permalink / raw)
  To: 13921

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

When I attempted to build CEDET from their bzr trunk (revno 8498), the
build failed due to expand-file-name function returning an incorrect "d:"
prefix.  Under other conditions expand-file-name returns the correct "c:"
prefix.  Some command line IO will illustrate:

[CEDET build issues this:]
 emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
"../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
--eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
/home/epich/sw/cedet/lisp/cedet
Debugger entered--Lisp error: (file-error "Opening output file" "no such
file or directory" "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  write-region(";;; loaddefs.el --- automatically extracted
autoloads\n;;\n;;; Code:\n\n\f\n(provide 'loaddefs)\n;; Local
Variables:\n;; version-control: never\n;; no-byte-compile: t\n;;
no-update-autoloads: t\n;; coding: utf-8\n;; End:\n;;; loaddefs.el ends
here\n" nil "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")

autoload-ensure-default-file("d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  autoload-find-generated-file()
  update-directory-autoloads("/home/epich/sw/cedet/lisp/cedet")
  apply(update-directory-autoloads "/home/epich/sw/cedet/lisp/cedet")
  batch-update-autoloads()
  command-line-1(("--eval" "(setq debug-on-error t)" "-l"
"../../cedet-remove-builtin.el" "-L" "." "--eval" "(progn (require (quote
cedet-compat)) (require (quote mode-local)))" "-L" "../eieio/" "-L" "./"
"-L" "./" "--eval" "(progn  (setq generated-autoload-file
\"/home/epich/sw/cedet/lisp/cedet/loaddefs.el\"))" "-f"
"batch-update-autoloads" "/home/epich/sw/cedet/lisp/cedet"))
  command-line()
  normal-top-level()

Comparing the backtrace above with the source code, it's evident
expand-file-name prepended the "d:" to the filename to get:
"d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el".

However, when I evaluate (expand-file-name
"/home/epich/sw/cedet/lisp/cedet") in the the scratch, I get
"c:/home/epich/sw/cedet/lisp/cedet".  I edited CEDET's Emacs command above
to exclude -f batch-update-autoloads and added a debug statement:

emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
"../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
--eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
file name is %s" (expand-file-name "/home/epich/sw/cedet/lisp/cedet")))'
/home/epich/sw/cedet/lisp/cedet
DEBUG: expanded file name is c:/home/epich/sw/cedet/lisp/cedet

This is as far as I investigated the bug.

I'm using the Emacs 24.2 Windows distribution, invoked within Cygwin:

epich@laptop02 ~/sw/cedet/lisp/cedet $ ls -l `which emacs`
lrwxrwxrwx 1 epich None 51 Nov  5 22:02 /home/epich/bin/emacs ->
/cygdrive/c/Users/epich/sw/emacs-24.2/bin/emacs.exe
epich@laptop02 ~/sw/cedet/lisp/cedet $ uname -srv
CYGWIN_NT-6.1-WOW64 1.7.17(0.262/5/3) 2012-10-19 14:39


In GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601)
 of 2012-08-28 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  shell-dirtrack-mode: t
  global-whitespace-mode: t
  evil-mode: t
  evil-local-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  tooltip-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
[snip]

Recent messages:
[snip]

Load-path shadows:
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/speedbar/speedbar hides
c:/Users/epich/sw/emacs-24.2/lisp/speedbar
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/speedbar/sb-image hides
c:/Users/epich/sw/emacs-24.2/lisp/sb-image
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/ezimage hides
c:/Users/epich/sw/emacs-24.2/lisp/ezimage
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/speedbar/dframe hides
c:/Users/epich/sw/emacs-24.2/lisp/dframe
~/.emacs.d/evil/lib/ert hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/ert
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio-speedbar
hides c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio-speedbar
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio-opt hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio-opt
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio-datadebug
hides c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio-datadebug
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio-custom hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio-custom
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/eieio-base hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/eieio-base
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/eieio/chart hides
c:/Users/epich/sw/emacs-24.2/lisp/emacs-lisp/chart
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/srecode/srecode hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/srecode
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/semantic/semantic hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/semantic
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/pulse hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/pulse
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/mode-local hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/mode-local
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/inversion hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/inversion
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/ede/ede hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/ede
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/data-debug hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/data-debug
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/cedet hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/cedet
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/cedet-idutils
hides c:/Users/epich/sw/emacs-24.2/lisp/cedet/cedet-idutils
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/cedet-global hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/cedet-global
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/cedet-files hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/cedet-files
c:/Users/epich/AppData/Roaming/.emacs.d/cedet-1.1/common/cedet-cscope hides
c:/Users/epich/sw/emacs-24.2/lisp/cedet/cedet-cscope

Features:
(shadow sort gnus-util mail-extr emacsbug message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils thingatpt eieio-opt help-mode view mule-util vc-dispatcher
vc-bzr org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc
org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda
org-info org-gnus org-docview org-bibtex bibtex org-bbdb org
ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src
ob-comint ob-keys ob ob-eval org-pcomplete org-list org-faces org-compat
org-entities org-macs format-spec cal-menu calendar cal-loaddefs
noutline outline easy-mmode semantic-edit semantic-make semanticdb-mode
semantic-decorate-include semanticdb-find semantic-decorate-mode
semantic-decorate pulse semantic-make-by make-mode shell pcomplete
dired-aux dired ffap semantic-el semantic-bovine bovine-debug
semantic-debug semantic-idle eldoc senator which-func semantic-imenu
semantic-sb imenu whitespace cus-start cus-load hippie-exp comint
regexp-opt ansi-color cedet cedet-contrib-load contrib-loaddefs
cogre-load cogre-loaddefs speedbar-load speedbar-loaddefs ede-load
ede-loaddefs ede-speedbar ede-files ede ede-base ede-auto eieio-speedbar
semantic-ia-sb semantic-analyze semantic-scope semantic-analyze-fcn
semantic-sort semanticdb-javap cedet-java semanticdb-el semanticdb-ref
semantic-find semanticdb semantic-ctxt semantic-format
semantic-util-modes semantic-util semantic semantic-lex semantic-tag-ls
semantic-tag working fame speedbar sb-image ezimage dframe easymenu
assoc eieio-custom wid-edit ede-source eieio-base srecode-load srecode
srecode-loaddefs semantic-load semantic-fw semantic-loaddefs mode-local
find-func derived eieio-load eieio-loaddefs cedet-load cedet-compat
cedet-loaddefs eieio warnings byte-opt bytecomp byte-compile cconv
macroexp inversion cl rainbow-delimiters evil evil-integration evil-maps
evil-commands evil-types evil-digraphs evil-search evil-ex evil-macros
evil-repeat evil-states evil-core advice help-fns advice-preload
evil-common windmove rect evil-vars ring edmacro kmacro goto-chg
undo-tree diff electric paren delsel autorevert time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp
w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)

[-- Attachment #2: Type: text/html, Size: 11489 bytes --]

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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-11  2:03 bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2 Barry OReilly
@ 2013-03-11 16:30 ` Eli Zaretskii
  2013-03-11 17:21   ` Barry OReilly
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-11 16:30 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 13921

> Date: Sun, 10 Mar 2013 22:03:31 -0400
> From: Barry OReilly <gundaetiapo@gmail.com>
> 
> When I attempted to build CEDET from their bzr trunk (revno 8498), the
> build failed due to expand-file-name function returning an incorrect "d:"
> prefix.  Under other conditions expand-file-name returns the correct "c:"
> prefix.  Some command line IO will illustrate:
> 
> [CEDET build issues this:]
>  emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> --eval '(progn  (setq generated-autoload-file
> "/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
> /home/epich/sw/cedet/lisp/cedet
> Debugger entered--Lisp error: (file-error "Opening output file" "no such
> file or directory" "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
>   write-region(";;; loaddefs.el --- automatically extracted
> autoloads\n;;\n;;; Code:\n\n\f\n(provide 'loaddefs)\n;; Local
> Variables:\n;; version-control: never\n;; no-byte-compile: t\n;;
> no-update-autoloads: t\n;; coding: utf-8\n;; End:\n;;; loaddefs.el ends
> here\n" nil "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
> 
> autoload-ensure-default-file("d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
>   autoload-find-generated-file()
>   update-directory-autoloads("/home/epich/sw/cedet/lisp/cedet")
>   apply(update-directory-autoloads "/home/epich/sw/cedet/lisp/cedet")
>   batch-update-autoloads()
>   command-line-1(("--eval" "(setq debug-on-error t)" "-l"
> "../../cedet-remove-builtin.el" "-L" "." "--eval" "(progn (require (quote
> cedet-compat)) (require (quote mode-local)))" "-L" "../eieio/" "-L" "./"
> "-L" "./" "--eval" "(progn  (setq generated-autoload-file
> \"/home/epich/sw/cedet/lisp/cedet/loaddefs.el\"))" "-f"
> "batch-update-autoloads" "/home/epich/sw/cedet/lisp/cedet"))
>   command-line()
>   normal-top-level()
> 
> Comparing the backtrace above with the source code, it's evident
> expand-file-name prepended the "d:" to the filename to get:
> "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el".
> 
> However, when I evaluate (expand-file-name
> "/home/epich/sw/cedet/lisp/cedet") in the the scratch, I get
> "c:/home/epich/sw/cedet/lisp/cedet".

This is not a bug in Emacs.  You are invoking a native Windows build
of Emacs from the Cygwin shell, which passes to Emacs Posix-style
absolute file names like /home/epich/sw/cedet/lisp/cedet.  But the
native Windows build of Emacs does not understand the Cygwin mounts,
so it cannot resolve such file names correctly.  What it does is
simply prepend the current drive's letter to the file name.

So when you expand-file-name in *scratch*, it takes the drive letter
of the default-directory defined in *scratch*, which is C:, because of
this:

> epich@laptop02 ~/sw/cedet/lisp/cedet $ ls -l `which emacs`
> lrwxrwxrwx 1 epich None 51 Nov  5 22:02 /home/epich/bin/emacs -> /cygdrive/c/Users/epich/sw/emacs-24.2/bin/emacs.exe

This tells me that Emacs comes up in a directory on drive C:, and thus
its default-directory in *scratch will be something on C:.

By contrast, compilation of CEDET was probably run somewhere on drive
D:, so /home/epich/sw/cedet/lisp/cedet/loaddefs.el got D: prepended to
it.

I don't know why you invoke Emacs from the Cygwin Bash.  I suggest not
to, or to switch to a Cygwin build of Emacs.  Mixing these two
environments is asking for trouble.

IOW, this is pilot error, not a bug.





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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-11 16:30 ` Eli Zaretskii
@ 2013-03-11 17:21   ` Barry OReilly
  2013-03-11 17:43     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Barry OReilly @ 2013-03-11 17:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 13921

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

> By contrast, compilation of CEDET was probably run somewhere on drive
> D:, so /home/epich/sw/cedet/lisp/cedet/loaddefs.el got D: prepended to
> it.

No, it wasn't.  I type these two commands at the Cygwin shell without
changing anything, including pwd:

emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
"../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
--eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
/home/epich/sw/cedet/lisp/cedet

emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
"../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
--eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
file name is %s" (expand-file-name "/home/epich/sw/cedet/lisp/cedet")))'
/home/epich/sw/cedet/lisp/cedet

The first yields an incorrect "d:" prefix, the second the "c:" prefix.  Why
would this be?  This is evidence of an Emacs bug.

> I don't know why you invoke Emacs from the Cygwin Bash.  I suggest not
> to, or to switch to a Cygwin build of Emacs.  Mixing these two
> environments is asking for trouble.

When I set up Cygwin, I did not install Cygwin's Emacs installation.  There
is no conflict with an alternate Emacs.  I am merely using Cygwin's GNU
Make to execute makefiles, which correctly invoke the Windows emacs.exe
binary.  Why shouldn't that work?

[-- Attachment #2: Type: text/html, Size: 1837 bytes --]

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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-11 17:21   ` Barry OReilly
@ 2013-03-11 17:43     ` Eli Zaretskii
  2013-03-11 17:54       ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-11 17:43 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 13921

> Date: Mon, 11 Mar 2013 13:21:38 -0400
> From: Barry OReilly <gundaetiapo@gmail.com>
> Cc: 13921@debbugs.gnu.org
> 
> > By contrast, compilation of CEDET was probably run somewhere on drive
> > D:, so /home/epich/sw/cedet/lisp/cedet/loaddefs.el got D: prepended to
> > it.
> 
> No, it wasn't.  I type these two commands at the Cygwin shell without
> changing anything, including pwd:
> 
> emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> --eval '(progn  (setq generated-autoload-file
> "/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
> /home/epich/sw/cedet/lisp/cedet
> 
> emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> --eval '(progn  (setq generated-autoload-file
> "/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
> file name is %s" (expand-file-name "/home/epich/sw/cedet/lisp/cedet")))'
> /home/epich/sw/cedet/lisp/cedet
> 
> The first yields an incorrect "d:" prefix, the second the "c:" prefix.  Why
> would this be?

I have no idea.  I don't have Cygwin installed, so I cannot try what
you did.  One way to try to figure that out would be for you to insert
'message' lines that display default-directory in a few places in the
code that gets run by this command, and see when it changes, and then
see why.

> This is evidence of an Emacs bug.

Sorry, but I need a more concrete evidence.  /foo/bar is not a
fully-qualified absolute name in the Windows build of Emacs, so we
need to establish where from does the drive letter come in this case,
before we can conclude whether or not it's an Emacs bug.  Taken at
face value, it is almost inconceivable that Emacs would somehow cough
up D: when the current drive is C:.

> > I don't know why you invoke Emacs from the Cygwin Bash.  I suggest not
> > to, or to switch to a Cygwin build of Emacs.  Mixing these two
> > environments is asking for trouble.
> 
> When I set up Cygwin, I did not install Cygwin's Emacs installation.  There
> is no conflict with an alternate Emacs.  I am merely using Cygwin's GNU
> Make to execute makefiles, which correctly invoke the Windows emacs.exe
> binary.  Why shouldn't that work?

Because Cygwin programs and native Windows programs are subtly
incompatible, in particular in their treatment of file names and drive
letters.  Cygwin can mount /home/foo to point to some arbitrary place
on any drive, whereas the native Windows build of Emacs does not grok
these mounts.





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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-11 17:43     ` Eli Zaretskii
@ 2013-03-11 17:54       ` Eli Zaretskii
  2013-03-13  0:45         ` Barry OReilly
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-11 17:54 UTC (permalink / raw)
  To: gundaetiapo; +Cc: 13921

> Date: Mon, 11 Mar 2013 19:43:53 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 13921@debbugs.gnu.org
> 
> > emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> > "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> > cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> > --eval '(progn  (setq generated-autoload-file
> > "/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
> > /home/epich/sw/cedet/lisp/cedet
> > 
> > emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> > "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> > cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> > --eval '(progn  (setq generated-autoload-file
> > "/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
> > file name is %s" (expand-file-name "/home/epich/sw/cedet/lisp/cedet")))'
> > /home/epich/sw/cedet/lisp/cedet
> > 
> > The first yields an incorrect "d:" prefix, the second the "c:" prefix.  Why
> > would this be?
> 
> I have no idea.  I don't have Cygwin installed, so I cannot try what
> you did.  One way to try to figure that out would be for you to insert
> 'message' lines that display default-directory in a few places in the
> code that gets run by this command, and see when it changes, and then
> see why.

One particular place to take a look is here (from autoload.el):

(defun autoload-generated-file ()
  (expand-file-name generated-autoload-file
                    ;; File-local settings of generated-autoload-file should
                    ;; be interpreted relative to the file's location,
                    ;; of course.
                    (if (not (local-variable-p 'generated-autoload-file))
                        (expand-file-name "lisp" source-directory)))) <<<<<<<<

What is source-directory in that run?





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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-11 17:54       ` Eli Zaretskii
@ 2013-03-13  0:45         ` Barry OReilly
  2013-03-13  3:52           ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Barry OReilly @ 2013-03-13  0:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 13921

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

I tried the following at the Cygwin shell:

epich@laptop02 ~/sw/cedet/lisp/cedet $  emacs -batch --no-site-file --eval
'(setq debug-on-error t)' -l "../../cedet-remove-builtin.el" -L . --eval
'(progn (require (quote cedet-compat)) (require (quote mode-local)))' -L
../eieio/ -L ./ -L ./ --eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
file name is %s source-directory is %s" (expand-file-name
"/home/epich/sw/cedet/lisp/cedet") source-directory))' -f
batch-update-autoloads /home/epich/sw/cedet/lisp/cedet
DEBUG: expanded file name is c:/home/epich/sw/cedet/lisp/cedet
source-directory is d:/devel/emacs/release/emacs24/emacs-24.2/
Debugger entered--Lisp error: (file-error "Opening output file" "no such
file or directory" "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  write-region(";;; loaddefs.el --- automatically extracted
autoloads\n;;\n;;; Code:\n\n\f\n(provide 'loaddefs)\n;; Local
Variables:\n;; version-control: never\n;; no-byte-compile: t\n;;
no-update-autoloads: t\n;; coding: utf-8\n;; End:\n;;; loaddefs.el ends
here\n" nil "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")

autoload-ensure-default-file("d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  autoload-find-generated-file()
  update-directory-autoloads("/home/epich/sw/cedet/lisp/cedet")
  apply(update-directory-autoloads "/home/epich/sw/cedet/lisp/cedet")
  batch-update-autoloads()
  command-line-1(("--eval" "(setq debug-on-error t)" "-l"
"../../cedet-remove-builtin.el" "-L" "." "--eval" "(progn (require (quote
cedet-compat)) (require (quote mode-local)))" "-L" "../eieio/" "-L" "./"
"-L" "./" "--eval" "(progn  (setq generated-autoload-file
\"/home/epich/sw/cedet/lisp/cedet/loaddefs.el\") (message \"DEBUG: expanded
file name is %s source-directory is %s\" (expand-file-name
\"/home/epich/sw/cedet/lisp/cedet\") source-directory))" "-f"
"batch-update-autoloads" "/home/epich/sw/cedet/lisp/cedet"))
  command-line()
  normal-top-level()

This shows c: and d: prefixes in the same message evaluation.

I haven't mentioned yet that I don't have a D drive mounted at all.

I tried C-h v source-directory in a running Emacs and found:

   source-directory is a variable defined in `lread.c'.
   Its value is "d:/devel/emacs/release/emacs24/emacs-24.2/"

   Documentation:
   Directory in which Emacs sources were found when Emacs was built.
   You cannot count on them to still be there!

I did not find this /devel/emacs/release/emacs24/emacs-24.2/ on my system,
nor is it the kind of path I would create.  My emacs is at
C:\Users\epich\sw\emacs-24.2 which appears in Cygwin at ~/sw/emacs-24.2
because ~/sw symlinks (MS console command mklink /d) to
/cygdrive/c/Users/epich/sw .

I actually launch Emacs from the Quick Launch on Windows 7, so the C-h v
evaluation has Cygwin out of the equation.  I merely use Cygwin to byte
compile.

[-- Attachment #2: Type: text/html, Size: 3400 bytes --]

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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-13  0:45         ` Barry OReilly
@ 2013-03-13  3:52           ` Eli Zaretskii
  2013-03-13 17:54             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-13  3:52 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 13921

> Date: Tue, 12 Mar 2013 20:45:45 -0400
> From: Barry OReilly <gundaetiapo@gmail.com>
> Cc: 13921@debbugs.gnu.org
> 
>    source-directory is a variable defined in `lread.c'.
>    Its value is "d:/devel/emacs/release/emacs24/emacs-24.2/"
> 
>    Documentation:
>    Directory in which Emacs sources were found when Emacs was built.
>    You cannot count on them to still be there!
> 
> I did not find this /devel/emacs/release/emacs24/emacs-24.2/ on my system,
> nor is it the kind of path I would create.

source-directory is where Emacs was built.  And since you didn't build
it yourself, this reflects the directory where whoever built it did
that.

And since Cygwin passes to Emacs a file name without a drive letter,
the logic in autoload.el causes the D: drive letter be added to
/home/epich/sw/cedet/lisp/cedet, because it doesn't expect a
semi-absolute file name like that, it expects either a relative file
name or a fully-qualified absolute one.

So this is a direct result of launching a native w32 Emacs from a
Cygwin Bash.





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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-13  3:52           ` Eli Zaretskii
@ 2013-03-13 17:54             ` Eli Zaretskii
  2013-03-14 12:16               ` Barry OReilly
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-13 17:54 UTC (permalink / raw)
  To: gundaetiapo; +Cc: 13921

> Date: Wed, 13 Mar 2013 05:52:58 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 13921@debbugs.gnu.org
> 
> >    source-directory is a variable defined in `lread.c'.
> >    Its value is "d:/devel/emacs/release/emacs24/emacs-24.2/"
> > 
> >    Documentation:
> >    Directory in which Emacs sources were found when Emacs was built.
> >    You cannot count on them to still be there!
> > 
> > I did not find this /devel/emacs/release/emacs24/emacs-24.2/ on my system,
> > nor is it the kind of path I would create.
> 
> source-directory is where Emacs was built.  And since you didn't build
> it yourself, this reflects the directory where whoever built it did
> that.
> 
> And since Cygwin passes to Emacs a file name without a drive letter,
> the logic in autoload.el causes the D: drive letter be added to
> /home/epich/sw/cedet/lisp/cedet, because it doesn't expect a
> semi-absolute file name like that, it expects either a relative file
> name or a fully-qualified absolute one.
> 
> So this is a direct result of launching a native w32 Emacs from a
> Cygwin Bash.

To make this more clear: this fragment:

  (defun autoload-generated-file ()
    (expand-file-name generated-autoload-file
		      ;; File-local settings of generated-autoload-file should
		      ;; be interpreted relative to the file's location,
		      ;; of course.
		      (if (not (local-variable-p 'generated-autoload-file))
			  (expand-file-name "lisp" source-directory))))

clearly assumes that either generated-autoload-file is a file name
relative to the Emacs's lisp directory, or it is an absolute file
name.  But in your case, it is an absolute file name without a drive
letter, so expand-file-name takes the drive letter from
source-directory.

A Cygwin specific workaround would be to use

  `cygpath -m /home/epich/sw/cedet/lisp/cedet/loaddefs.el`

which will supply the missing drive letter.  (Yes, that means you need
to hack the CEDET build scripts.)





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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-13 17:54             ` Eli Zaretskii
@ 2013-03-14 12:16               ` Barry OReilly
  2013-03-14 16:38                 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Barry OReilly @ 2013-03-14 12:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 13921

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

Thanks for your help, Eli.

[-- Attachment #2: Type: text/html, Size: 35 bytes --]

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

* bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
  2013-03-14 12:16               ` Barry OReilly
@ 2013-03-14 16:38                 ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2013-03-14 16:38 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 13921-done

> Date: Thu, 14 Mar 2013 08:16:39 -0400
> From: Barry OReilly <gundaetiapo@gmail.com>
> Cc: 13921@debbugs.gnu.org
> 
> Thanks for your help, Eli.

You are welcome, closing.





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

end of thread, other threads:[~2013-03-14 16:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11  2:03 bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2 Barry OReilly
2013-03-11 16:30 ` Eli Zaretskii
2013-03-11 17:21   ` Barry OReilly
2013-03-11 17:43     ` Eli Zaretskii
2013-03-11 17:54       ` Eli Zaretskii
2013-03-13  0:45         ` Barry OReilly
2013-03-13  3:52           ` Eli Zaretskii
2013-03-13 17:54             ` Eli Zaretskii
2013-03-14 12:16               ` Barry OReilly
2013-03-14 16:38                 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.