From unknown Mon Jun 23 02:22:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15130 <15130@debbugs.gnu.org> To: bug#15130 <15130@debbugs.gnu.org> Subject: Status: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Reply-To: bug#15130 <15130@debbugs.gnu.org> Date: Mon, 23 Jun 2025 09:22:33 +0000 retitle 15130 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p'= bug. reassign 15130 emacs submitter 15130 Thierry Volpiatto severity 15130 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 04:48:20 2013 Received: (at submit) by debbugs.gnu.org; 19 Aug 2013 08:48:20 +0000 Received: from localhost ([127.0.0.1]:39863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBL8K-0001Km-0K for submit@debbugs.gnu.org; Mon, 19 Aug 2013 04:48:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36567) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBL8D-0001KN-B3 for submit@debbugs.gnu.org; Mon, 19 Aug 2013 04:48:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBL80-0004da-MQ for submit@debbugs.gnu.org; Mon, 19 Aug 2013 04:48:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-99.2 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBL80-0004dU-KA for submit@debbugs.gnu.org; Mon, 19 Aug 2013 04:47:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBL7t-0004JZ-Co for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 04:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBL7m-0004aC-3u for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 04:47:49 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:37722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBL7l-0004Zp-RE for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 04:47:42 -0400 Received: by mail-wi0-f173.google.com with SMTP id en1so2794378wid.12 for ; Mon, 19 Aug 2013 01:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=0XRqh9jFu7bJnq+iWwNLOnNnSjKdQlpuSEB5ca8f7rw=; b=H2M2MJNnRDuiQ3lr97HPAgMSD2AJQR+rKGGZFn3ctHMf+EfoWEPbC6mcgtrsbO+pTt pY6p5RrqYi/UCXeQB8jZ/3IPdgKhlSp1/7x06PDaKUaEwyf1S+4oVNLnP1yOht9dBiMX rF9aCif5UGWuy6dB7adtDQiU7CuUtJjN/03spDp1bNVfV/Lx1uXSZffqknFp3iowMo4G jLEMpxl8H2w9izcS+58rTsNIcEpADkEBLWDcHJpWiDheTCIo85rXyU3LACNVKiT5+wGk sXkSjZsW7sjpWlONFuGDjE521ZgQ1YcTsO5+u3D8jOkBrxcIYy1kfigMvpcSRQIVTdmi jxHg== X-Received: by 10.194.77.167 with SMTP id t7mr7750143wjw.27.1376902060593; Mon, 19 Aug 2013 01:47:40 -0700 (PDT) Received: from dell-14z ([37.161.126.110]) by mx.google.com with ESMTPSA id l7sm15005845wiw.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 19 Aug 2013 01:47:40 -0700 (PDT) From: Thierry Volpiatto To: bug-gnu-emacs@gnu.org Subject: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Date: Mon, 19 Aug 2013 10:47:24 +0200 Message-ID: <87y57yjcdf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi, On windows `file-directory-p' returns t on a path with a space added at end. ;; windows-nt (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/") t (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/ ") t ;; gnu/linux (file-directory-p "~/.emacs.d/") t (file-directory-p "~/.emacs.d/ ") nil Is it wanted? In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2013-08-19 on dell-14z Windowing system distributor `The X.Org Foundation', version 11.0.11103000 System Description: Ubuntu 12.04.2 LTS Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: fr_FR.UTF-8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: recentf-mode: t TeX-PDF-mode: t winner-mode: t global-undo-tree-mode: t undo-tree-mode: t auto-image-file-mode: t eldoc-in-minibuffer-mode: t show-paren-mode: t display-time-mode: t savehist-mode: t golden-ratio-mode: t eldoc-mode: t minibuffer-depth-indicate-mode: t diff-auto-refine-mode: t helm-mode: t helm-descbinds-mode: t shell-dirtrack-mode: t helm-adaptative-mode: t helm-match-plugin-mode: t tooltip-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-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: s c C-y C-SPC C-n C-g M-( f i l e - d i r e c t o r y - p SPC M-" ~ / . e m a c s . d / C-j C-M-SPC M-w C-y SPC C-j ; ; SPC G N U / L i n u x ; ; SPC W i n d o w s - n t M-: s y s t e m - t y p e l g n u w C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-w M-x r e p o r t Recent messages: Running git pull -v git finished. Here is not Git work tree Mark set [2 times] Quit Mark set [2 times] Evaluating... Here is not Git work tree gnu/linux Mark set Load-path shadows: /usr/local/share/emacs/24.3.50/lisp/gnus/.dir-locals hides ~/elisp/magit/.dir-locals ~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath ~/elisp/Emacs-wgrep/wgrep-ack hides ~/elisp/jenkins/emacs-wgrep/wgrep-ack ~/elisp/Emacs-wgrep/wgrep-helm hides ~/elisp/jenkins/emacs-wgrep/wgrep-helm ~/elisp/Emacs-wgrep/wgrep-test hides ~/elisp/jenkins/emacs-wgrep/wgrep-test ~/elisp/Emacs-wgrep/wgrep hides ~/elisp/jenkins/emacs-wgrep/wgrep /usr/local/share/emacs/24.3.50/lisp/emacs-lisp/tq hides ~/elisp/emms/lisp/tq ~/.emacs.d/.gnus hides ~/.emacs.d/emacs-config-laptop/.gnus Features: (shadow epa-mail emacsbug helm-command tramp-cache tramp-sh helm-bmkext cl-indent help-mode gnus-html url-cache smiley gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml nndraft nnmh utf-7 nnimap utf7 nnml nnfolder parse-time netrc network-stream starttls tls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-dired nnir gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win helm-dabbrev view recentf ido preview prv-emacs tex-buf reftex-dcr reftex-auc reftex imenu reftex-vars font-latex latex tex-style tex dbus latexenc cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs conf-mode vc-dispatcher vc-rcs sh-script smie executable vc-git naquadah-theme em-smart em-unix em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias align-let git-gutter server package winner undo-tree diff slime-xref-browser slime-banner slime-tramp slime-asdf slime-fancy slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-parse slime-repl elp image-file newsticker newst-treeview tree-widget newst-plainview newst-reader newst-ticker newst-backend xdvi-search preview-latex pcomplete-extension em-term term disp-table ehelp electric helm-ipython helm-elisp helm-eval python rx eldoc-eval whitespace paren time avoid savehist warnings emamux golden-ratio smtpmail-async smtpmail sendmail helm-async persistent-sessions config-w3m w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util w3m-load boxquote markdown-mode iterator google-maps google-maps-static google-maps-geocode google-maps-base json simple-call-tree iedit-rect rect iedit iedit-lib zop-to-char smallurl mm-url gnus gnus-ems nnheader rectangle-utils ledger-config ledger esh-var esh-io esh-cmd esh-opt esh-ext esh-proc eldoc esh-groups eshell esh-module esh-mode esh-arg esh-util tv-utils async pcvs vc-cvs pcvs-parse pcvs-info pcvs-defs ewoc mb-depth ioccur cl-info slime hyperspec slime-autoloads tex-site auto-loads esh-toggle flymake no-word dired-extension emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer emms-info emms-streams later-do emms-source-playlist emms-source-file emms-player-simple emms-setup emms emms-compat magit-blame magit-stgit magit-cherry magit-bisect magit-log-edit log-edit pcvs-util add-log magit-key-mode magit diff-mode magit-compat htmlize-hack htmlize muse-colors muse-docbook muse-texinfo texnfo-upd texinfo muse-latex muse-html muse-xml-common muse-wiki cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps wid-edit muse muse-nested-tags muse-mode muse-autoloads org-config-thierry ob-sh cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs vc-hg 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-info org-gnus org-docview org-bibtex bibtex org-bbdb org-agenda appt diary-lib diary-loaddefs org-annotation-helper org-capture org-mks remember org-remember org-datetree addressbook-bookmark message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader firefox-protocol bookmark-firefox-handler bookmark-extensions bookmark pp init-helm-thierry helm-mode helm-ls-git helm-descbinds helm-ls-hg helm-files image-dired tramp tramp-compat tramp-loaddefs trampver shell dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap helm-plugin helm-help helm-match-plugin helm-grep wgrep-helm wgrep helm-regexp grep helm-external helm-utils dired compile helm-locate helm helm-config helm-aliases epa-file epa derived epg epg-config auth-source eieio eieio-core gnus-util mm-util mail-prsvr password-cache usage-memo w3m-wget info cl-macs gv edmacro kmacro org-crypt org byte-opt bytecomp byte-compile cconv ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-entities time-date noutline outline easy-mmode org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs format-spec find-func cal-menu easymenu calendar cal-loaddefs advice help-fns net-utils cl cl-loaddefs cl-lib tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-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 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 11:42:58 2013 Received: (at 15130) by debbugs.gnu.org; 19 Aug 2013 15:42:58 +0000 Received: from localhost ([127.0.0.1]:40613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBRbe-0006ig-0m for submit@debbugs.gnu.org; Mon, 19 Aug 2013 11:42:58 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:65149) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBRbb-0006iO-Sj for 15130@debbugs.gnu.org; Mon, 19 Aug 2013 11:42:56 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MRS00000BL6XV00@a-mtaout20.012.net.il> for 15130@debbugs.gnu.org; Mon, 19 Aug 2013 18:42:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MRS000YCBN9MJ60@a-mtaout20.012.net.il>; Mon, 19 Aug 2013 18:42:45 +0300 (IDT) Date: Mon, 19 Aug 2013 18:43:25 +0300 From: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. In-reply-to: <87y57yjcdf.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Thierry Volpiatto Message-id: <83haellm8y.fsf@gnu.org> References: <87y57yjcdf.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Thierry Volpiatto > Date: Mon, 19 Aug 2013 10:47:24 +0200 > > On windows `file-directory-p' returns t on a path with a space added at > end. > > ;; windows-nt > (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/") > t > (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/ ") > t > ;; gnu/linux > (file-directory-p "~/.emacs.d/") > t > (file-directory-p "~/.emacs.d/ ") > nil > > Is it wanted? It's wanted only if you really have a directory named " " under 'c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/' ;-) Seriously, though: this is not Emacs's fault. There's no code in Emacs that removes that space from the name; we simply hand the (expanded) file name to the Windows API that returns file attributes, and if the returned attributes say it's a directory, we return t. More generally, all Win32 APIs ignore trailing whitespace in file names. OTOH, it _is_ possible to create file names such as "/foo/ " on Windows (by using a file-name syntax that bypasses the Win32 file-name normalization layer), so rejecting file names such as the one you show is not an option. On the third hand, converting every file name to that syntax internally, so that we bypass the normalization, is a large job, whose risks are unknown, at least to me, and whose gains are quite small, since use cases where you trip upon such problems are very rare (can you tell what was your use case, btw?). So I think we will have to continue living with this idiosyncrasy of Windows filesystems. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 02:35:36 2013 Received: (at 15130) by debbugs.gnu.org; 20 Aug 2013 06:35:36 +0000 Received: from localhost ([127.0.0.1]:41822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBfXR-0001s5-3I for submit@debbugs.gnu.org; Tue, 20 Aug 2013 02:35:33 -0400 Received: from mail-ea0-f180.google.com ([209.85.215.180]:40599) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBfXL-0001rn-CY for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 02:35:31 -0400 Received: by mail-ea0-f180.google.com with SMTP id h10so8125eaj.25 for <15130@debbugs.gnu.org>; Mon, 19 Aug 2013 23:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=bLz8DynfCg7hVBGSTwqXdKekIMR6nAHBC+ZBkGX5N/U=; b=nLiWkZkWJnGveenanTpNtDXH1ZyGB9d6AZMLp9ARDyIyIoAHEqmV8lzYYfIhDRtHLW /IaCvd3C3bgS2+fwJZL/XqZ5jG6/ssTiMaBdNsqruZnpaGpWIvcmfMMqX3g0SAjzgsNa jEUUqE77KbaHVFeR0TYAQVyIk6oVXyS9AbrHqEATa7r/aXAI0gopWU0+PYRorEPLA5Hn xZRBfEsQeqHKU/3DwrjdH3j2upC0meZ2yJZ0LaoIgNLkoFsoT1tm5LxIRc5+/FTTjMmD DvHOUMJzKZBtGTo1ITjeQ//CIyZi/s4j9AcvlVahKctMEnXBD5ZQeZJrWUP7WNUu99PI poiw== X-Received: by 10.14.220.200 with SMTP id o48mr12065eep.62.1376980526432; Mon, 19 Aug 2013 23:35:26 -0700 (PDT) Received: from dell-14z ([37.161.64.96]) by mx.google.com with ESMTPSA id h52sm105501eez.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 19 Aug 2013 23:35:25 -0700 (PDT) From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Organization: Emacs Helm References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> Date: Tue, 20 Aug 2013 08:35:13 +0200 In-Reply-To: <83haellm8y.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Aug 2013 18:43:25 +0300") Message-ID: <87mwoczx7i.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> From: Thierry Volpiatto >> Date: Mon, 19 Aug 2013 10:47:24 +0200 >> >> On windows `file-directory-p' returns t on a path with a space added at >> end. >> >> ;; windows-nt >> (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/") >> t >> (file-directory-p "c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/ ") >> t >> ;; gnu/linux >> (file-directory-p "~/.emacs.d/") >> t >> (file-directory-p "~/.emacs.d/ ") >> nil >> >> Is it wanted? > > It's wanted only if you really have a directory named " " under > 'c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/' ;-) > > Seriously, though: this is not Emacs's fault. There's no code in > Emacs that removes that space from the name; we simply hand the > (expanded) file name to the Windows API that returns file attributes, > and if the returned attributes say it's a directory, we return t. > > More generally, all Win32 APIs ignore trailing whitespace in file > names. OTOH, it _is_ possible to create file names such as "/foo/ " > on Windows (by using a file-name syntax that bypasses the Win32 > file-name normalization layer), so rejecting file names such as the > one you show is not an option. On the third hand, converting every > file name to that syntax internally, so that we bypass the > normalization, is a large job, whose risks are unknown, at least to > me, and whose gains are quite small, since use cases where you trip > upon such problems are very rare Of course, fixing that on the emacs side is not an option. > (can you tell what was your use case, btw?). If I enter in minibuffer e.g "~/.emacs.d" helm detect that ".emacs.d" is a directory, append a "/" and give completion on this directory. When I enter in minibuffer "~/.emacs.d/ " it wait for multi regexp completion, e.g I can enter then "~/.emacs.d/ i ni el" or "~/.emacs.d/ el$" to complete "init.el" or all *.el files in this directory. On Windows, as soon I enter the trailing space, the directory (which doesn't exists) "~/.emacs.d/ " is detected and the end slash is added to complete against "~/.emacs.d/ /" which is unwanted. Though hitting C- disable this feature and allow entering a space without instant completion. > So I think we will have to continue living with this idiosyncrasy of > Windows filesystems. Yes. Thanks for explanations, probably you can close this bug. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 02:38:06 2013 Received: (at 15130) by debbugs.gnu.org; 20 Aug 2013 06:38:06 +0000 Received: from localhost ([127.0.0.1]:41828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBfZs-0001yb-GP for submit@debbugs.gnu.org; Tue, 20 Aug 2013 02:38:05 -0400 Received: from mail-ee0-f50.google.com ([74.125.83.50]:48658) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBfZm-0001y2-3d for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 02:37:58 -0400 Received: by mail-ee0-f50.google.com with SMTP id d51so8433eek.37 for <15130@debbugs.gnu.org>; Mon, 19 Aug 2013 23:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=s7C3Ib3NBAT7QEk6z31ak7WHqjWHjuXkwIbkX9kgL3I=; b=KI5KADzpfAAuSbozbX7BZ/8OSJicnm05MOBZCmZb2pCg4UqW9EeAnMILmu0R237NF4 VRNoHFwbYdKfZRnGgEsfV23GgStK470U1l5HaIzWbkB4s3+LFbkkIOaqQx0jDKUQJCK8 G8WAYPLjl0AlMRSblWsT6phh668tXIusj0iUhKyKJfKQXYRF4GFNOLe5IrBdpKaysOOR 58Jg0cdlsVy44FnxJGjSpb82BKtW7SBHKRoNV3NXbTzHjpGP8ekM1d9Q14cZ6Nvwy5Lg 5qbHhFZwJpZpD0EVtKrEm5OGBgpuD+FxZlR3B9pzYZ6e6sR6JLIlwW42+cHV+tM4taWW rV6w== X-Received: by 10.14.111.9 with SMTP id v9mr59477eeg.35.1376980677298; Mon, 19 Aug 2013 23:37:57 -0700 (PDT) Received: from dell-14z ([37.161.64.96]) by mx.google.com with ESMTPSA id k7sm67344eeg.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 19 Aug 2013 23:37:56 -0700 (PDT) From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Organization: Emacs Helm References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> Date: Tue, 20 Aug 2013 08:37:50 +0200 In-Reply-To: <83haellm8y.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Aug 2013 18:43:25 +0300") Message-ID: <87ioz0zx35.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) BTW maybe the description of this behavior can be mentioned in manual? -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 07:47:32 2013 Received: (at 15130) by debbugs.gnu.org; 20 Aug 2013 11:47:32 +0000 Received: from localhost ([127.0.0.1]:42201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBkPL-0003NK-Jy for submit@debbugs.gnu.org; Tue, 20 Aug 2013 07:47:31 -0400 Received: from mail-ea0-f177.google.com ([209.85.215.177]:49596) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBkPK-0003N9-3f for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 07:47:30 -0400 Received: by mail-ea0-f177.google.com with SMTP id f15so162090eak.22 for <15130@debbugs.gnu.org>; Tue, 20 Aug 2013 04:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Q4aTfBk4ZpriWKCgoqLgUXuDPkoFG3+n+QOcFX0iSYU=; b=ZGIflbk5VQJvhW6p7uAaJ8ppNqd3f93NeKeTqo1IoTDZJibMFeDtK9Ocr3Z1VWIaLA pcHi5I8kwuhA04yUSmb1rPHnztVn0xdd/q9Rrrh04cbBQ0yrxObiZaOvdfQB1aN1kmKE P+YikBRHdJxxyCSwb+Q2uv4PEMQV4wNoSvKLpoHTLEJwqjoHbn6yx6qi31qGv83F6cgH FgA4etN/ljv4zYc/z2YvB8465RQPSNkKmLt8GkAS0S+RRzq77miFCyegGQcuFPDz+8N4 +DOs2g5CCypZpvwJ+7SE2J61KcSzxeygdGErHkX6hX57R6ckptEQlQQBDe/lMKWwj8UI QErA== X-Received: by 10.14.210.8 with SMTP id t8mr1771801eeo.39.1376999249087; Tue, 20 Aug 2013 04:47:29 -0700 (PDT) Received: from dell-14z ([37.161.91.32]) by mx.google.com with ESMTPSA id a43sm1853809eep.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 04:47:28 -0700 (PDT) From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Organization: Emacs Helm References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> Date: Tue, 20 Aug 2013 13:47:21 +0200 In-Reply-To: <83haellm8y.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Aug 2013 18:43:25 +0300") Message-ID: <874nakoa7q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > It's wanted only if you really have a directory named " " under > 'c:/Program Files/emacs-24.3-bin-i386/emacs-24.3/site-lisp/' ;-) BTW, actually using: (eq t (car (file-attributes (file-name-as-directory directory)))) seems to be an option to know if we really have a directory named " ". -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 10:29:42 2013 Received: (at 15130) by debbugs.gnu.org; 20 Aug 2013 14:29:42 +0000 Received: from localhost ([127.0.0.1]:42668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBmwH-0007jE-0F for submit@debbugs.gnu.org; Tue, 20 Aug 2013 10:29:41 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:41348) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBmwD-0007j2-EZ for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 10:29:38 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MRU00F002IEMS00@a-mtaout20.012.net.il> for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 17:29:06 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MRU00FCB2WHJO30@a-mtaout20.012.net.il>; Tue, 20 Aug 2013 17:29:06 +0300 (IDT) Date: Tue, 20 Aug 2013 17:29:48 +0300 From: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. In-reply-to: <874nakoa7q.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Thierry Volpiatto Message-id: <8361v0l9k3.fsf@gnu.org> References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> <874nakoa7q.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Thierry Volpiatto > Cc: 15130@debbugs.gnu.org > Date: Tue, 20 Aug 2013 13:47:21 +0200 > > BTW, actually using: > > (eq t (car (file-attributes (file-name-as-directory directory)))) > > seems to be an option to know if we really have a directory named " ". I suggest to use file-accessible-directory-p instead of file-attributes, the former is much cheaper on MS-Windows. And if you are wondering why file-accessible-directory-p works where file-directory-p doesn't, then the reason is that the latter internally removes trailing slashes, so file-name-as-directory has no effect in that case. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 10:37:21 2013 Received: (at 15130) by debbugs.gnu.org; 20 Aug 2013 14:37:21 +0000 Received: from localhost ([127.0.0.1]:42684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBn3g-00080R-KB for submit@debbugs.gnu.org; Tue, 20 Aug 2013 10:37:20 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:62831) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBn3c-00080E-GA for 15130@debbugs.gnu.org; Tue, 20 Aug 2013 10:37:18 -0400 Received: by mail-ee0-f48.google.com with SMTP id l10so245867eei.7 for <15130@debbugs.gnu.org>; Tue, 20 Aug 2013 07:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=hT3D8rR8bn+MA2Z3MhbUqv34sj31/N9ecQT06CSaP2U=; b=hdrCqUsp8UkrN5zGRNyTwoabGzwFiH3CSrzZWHn9IavfLdneEpJeby63LkenOPG47w VJLRwUV8J8PZaUHgDnmru3LJoJk4xumwT/fdahwpeQRVBxCv7CNr71w47oiV2KK5z4xN A7PtUktlTpEdgTNyGUIS1NGP5flGs7ePub/MHf7xApgYsMk7JoooKlZN8/MELrgnEPGm A8gMDvP2EmUvOFIkJN4jydG2qopIi7Bh1rlHaL/Qc5dphCwUYQDHJviaHTPaz+Sc3yyB +kvSC2bPtUQaj8Gd7gs5/HWv/0yaGIAtGHOM9Eowg57O5JKEANKv1iUOWim2/cISK61h caew== X-Received: by 10.14.210.8 with SMTP id t8mr2785910eeo.39.1377009435592; Tue, 20 Aug 2013 07:37:15 -0700 (PDT) Received: from dell-14z ([37.161.91.32]) by mx.google.com with ESMTPSA id a6sm2827285eei.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 07:37:15 -0700 (PDT) From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. Organization: Emacs Helm References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> <874nakoa7q.fsf@gmail.com> <8361v0l9k3.fsf@gnu.org> Date: Tue, 20 Aug 2013 16:37:06 +0200 In-Reply-To: <8361v0l9k3.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Aug 2013 17:29:48 +0300") Message-ID: <87zjscmnsd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15130 Cc: 15130@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: 15130@debbugs.gnu.org >> Date: Tue, 20 Aug 2013 13:47:21 +0200 >> >> BTW, actually using: >> >> (eq t (car (file-attributes (file-name-as-directory directory)))) >> >> seems to be an option to know if we really have a directory named " ". > > I suggest to use file-accessible-directory-p instead of > file-attributes, the former is much cheaper on MS-Windows. Great, thanks. > And if you are wondering why file-accessible-directory-p works where > file-directory-p doesn't, then the reason is that the latter > internally removes trailing slashes, so file-name-as-directory has no > effect in that case. Ok. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 10:50:21 2013 Received: (at 15130-done) by debbugs.gnu.org; 20 Aug 2013 14:50:21 +0000 Received: from localhost ([127.0.0.1]:42708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBnGH-0008Qz-5y for submit@debbugs.gnu.org; Tue, 20 Aug 2013 10:50:21 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:46594) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBnGF-0008Qm-Af for 15130-done@debbugs.gnu.org; Tue, 20 Aug 2013 10:50:20 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MRU00F003TVVZ00@a-mtaout20.012.net.il> for 15130-done@debbugs.gnu.org; Tue, 20 Aug 2013 17:49:23 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MRU00FJS3UAN870@a-mtaout20.012.net.il>; Tue, 20 Aug 2013 17:49:23 +0300 (IDT) Date: Tue, 20 Aug 2013 17:50:05 +0300 From: Eli Zaretskii Subject: Re: bug#15130: 24.3.50; emacs-24.3.1 on Windows; possible `file-directory-p' bug. In-reply-to: <87ioz0zx35.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Thierry Volpiatto Message-id: <8338q4l8ma.fsf@gnu.org> References: <87y57yjcdf.fsf@gmail.com> <83haellm8y.fsf@gnu.org> <87ioz0zx35.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15130-done Cc: 15130-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Thierry Volpiatto > Cc: 15130@debbugs.gnu.org > Date: Tue, 20 Aug 2013 08:37:50 +0200 > > BTW maybe the description of this behavior can be mentioned in manual? Done in trunk revision 113959. From unknown Mon Jun 23 02:22:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Sep 2013 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator