From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K 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 22:54:57 +0530 Message-ID: <87zk236jrq.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354036999 3676 80.91.229.3 (27 Nov 2012 17:23:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2012 17:23:19 +0000 (UTC) Cc: Ista Zahn To: 13013@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 27 18:23:31 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 1TdOsb-0002RE-SY for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2012 18:23:30 +0100 Original-Received: from localhost ([::1]:51200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOsQ-0004je-Gi for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2012 12:23:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOsN-0004jX-3E for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:23:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdOsL-0003Pb-H2 for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:23:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOsL-0003PT-DI for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:23:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TdOu6-0000XW-KT for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Nov 2012 17:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13540370842037 (code B ref -1); Tue, 27 Nov 2012 17:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2012 17:24:44 +0000 Original-Received: from localhost ([127.0.0.1]:41950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdOtn-0000Wn-K9 for submit@debbugs.gnu.org; Tue, 27 Nov 2012 12:24:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35434) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdOtl-0000Wg-7R for submit@debbugs.gnu.org; Tue, 27 Nov 2012 12:24:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdOrt-00034L-Mp for submit@debbugs.gnu.org; Tue, 27 Nov 2012 12:22:51 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:60775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOrt-00033c-IR for submit@debbugs.gnu.org; Tue, 27 Nov 2012 12:22:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOrn-0004hI-OC for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:22:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdOrc-0002vD-7Y for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:22:39 -0500 Original-Received: from mail-da0-f41.google.com ([209.85.210.41]:55760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdOrc-0002ux-1K for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 12:22:28 -0500 Original-Received: by mail-da0-f41.google.com with SMTP id e20so4250493dak.0 for ; Tue, 27 Nov 2012 09:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type; bh=p97ufAXvYya5izNuGHy+Gu2uPKa3GQoHhgjvD3N0mVA=; b=TFMks/cfTn79hVLWr9aEFZP9/7p/bMFnBIz2Hab5C13wVZvqNUbqh2rnvblZvaEF+a u5nbM5xoTQvGkt20c8Wke2L4zp8ryINH+OZ+ey1esSwjT/OSI7TPMhgVqSLp2IXSBFkn SeahynlVnaKL1PvcVN2Y03ILfedXqKABwj49yCJ9XWqTSYv6xxIPUefnKBsp/q8hK+kn wR62tODEVi/Z2SGwtNlK//Hu7dtAZ41W16jAB/QX3HF1j++Aj9kS7zhO5PPuLKAoShPG Nhm4jCKw1QZQVnexaJvGtCNYa1iZ7QLA9MmuuJN3q97DmoFDqyb+w/xDHibMzQBFEc7K RFLg== Original-Received: by 10.66.76.10 with SMTP id g10mr44221732paw.80.1354036947332; Tue, 27 Nov 2012 09:22:27 -0800 (PST) Original-Received: from debian-6.05 ([115.184.83.157]) by mx.google.com with ESMTPS id ix9sm10930688pbc.7.2012.11.27.09.22.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 09:22:26 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:67520 Archived-At: This report is a digest of following thread: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg62455.html. 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" The problem is better explained with ielm session below. 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")) Here is what Ista reports: *** Welcome to IELM *** Type (describe-mode) for help. ELISP> (setq org-e-odt-zip-dir (file-name-as-directory (make-temp-file "odt-" t))) "c:/DOCUME~1/IZAHN/LOCALS~1/Temp/odt-8052VuJ/" ELISP> (with-current-buffer (find-file-noselect (concat org-e-odt-zip-dir "content.xml") t) (buffer-file-name)) "c:/Documents and Settings/IZAHN/Local Settings/Temp/odt-8052VuJ/content.xml" ELISP> (with-current-buffer (get-file-buffer (concat org-e-odt-zip-dir "content.xml")) (save-buffer 0)) *** Eval error *** Wrong type argument: stringp, nil ELISP> (get-file-buffer (concat org-e-odt-zip-dir "content.xml")) nil ELISP> I am surprised that `get-file-buffer' is returning nil. Why is there a mismatch between file names as reported by `file-name-as-directory' and `buffer-file-name'. The problem is seen with Ista's machine (CCed here) with the following setup. ,---- | GNU Emacs 24.2.1 (i386-mingw-nt5.1.2600) of 2012-08-28 on MARVIN | | I have cygwin installed, but emacs is the windows version from | http://ftp.gnu.org/gnu/emacs/windows/ | | The OS is Windows XP professional with service pack 3. `---- Apparently the problem is not seen with either here or ,---- | Windows 7 | GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN `---- here ,---- | GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN | Windows 7 `----