From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#13013: 24.3.50; Windows XP bug? get-file-buffer, file-name-as-directory Date: Tue, 27 Nov 2012 20:01:19 +0200 Message-ID: <831uffx6vk.fsf@gnu.org> References: <87zk236jrq.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1354039354 25779 80.91.229.3 (27 Nov 2012 18:02:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2012 18:02:34 +0000 (UTC) Cc: istazahn@gmail.com, 13013@debbugs.gnu.org To: Jambunathan K Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 27 19:02:44 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TdPUZ-0001cG-OI for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2012 19:02:43 +0100 Original-Received: from localhost ([::1]:37485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdPUN-0006ui-Q5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2012 13:02:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdPUC-0006tx-Sr for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 13:02:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdPU4-00023v-Jy for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 13:02:20 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdPU4-00023p-Fv for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 13:02:12 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TdPVp-0001Vg-OF for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 13:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Nov 2012 18:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13013-submit@debbugs.gnu.org id=B13013.13540394055745 (code B ref 13013); Tue, 27 Nov 2012 18:04:01 +0000 Original-Received: (at 13013) by debbugs.gnu.org; 27 Nov 2012 18:03:25 +0000 Original-Received: from localhost ([127.0.0.1]:42014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdPVE-0001Ub-91 for submit@debbugs.gnu.org; Tue, 27 Nov 2012 13:03:24 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:56818) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdPVB-0001US-J8 for 13013@debbugs.gnu.org; Tue, 27 Nov 2012 13:03:23 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0ME500M00RCJB700@a-mtaout22.012.net.il> for 13013@debbugs.gnu.org; Tue, 27 Nov 2012 20:01:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0ME500LW5RDSQ1C0@a-mtaout22.012.net.il>; Tue, 27 Nov 2012 20:01:04 +0200 (IST) In-reply-to: <87zk236jrq.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:67525 Archived-At: > From: Jambunathan K > Date: Tue, 27 Nov 2012 22:54:57 +0530 > Cc: Ista Zahn > > > This report is a digest of following thread: > http://www.mail-archive.com/emacs-orgmode@gnu.org/msg62455.html. I will read it soon, for now replying only based on what you posted. > The problem is because of Emacs mangling file paths like this on Windows > XP. > > "c:/DOCUME~1/IZAHN/LOCALS~1/Temp/odt-8052VuJ/" > "c:/Documents and Settings/IZAHN/Local Settings/Temp/odt-8052VuJ/content.xml" Emacs doesn't mangle file names. Emacs uses the value of TEMP environment variable, which Windows sets to a 8+3 alias of the long name (evidently trying to avoid bugs in programs that don't handle whitespace in file names). Emacs then converts the 8+3 alias to the full long name when it stores the file name in the buffer object of the buffer that visits the file. > Create a ielm buffer with > M-x ielm RET > > and type out the following 4 lisp forms ONE-by-ONE. > > (setq org-e-odt-zip-dir (file-name-as-directory (make-temp-file "odt-" t))) > > (with-current-buffer (find-file-noselect (concat org-e-odt-zip-dir "content.xml") t) (buffer-file-name)) > > (with-current-buffer (get-file-buffer (concat org-e-odt-zip-dir "content.xml")) (save-buffer 0)) > > (get-file-buffer (concat org-e-odt-zip-dir "content.xml")) The solution is to call file-truename on (concat org-e-odt-zip-dir "content.xml") Think of the 8+3 name as a symlink to the long file name. > I am surprised that `get-file-buffer' is returning nil. It returns nil because it compares file names with string-equal. > Why is there a mismatch between file names as reported by > `file-name-as-directory' and `buffer-file-name'. See above. Won't the same happen with symlinks?