GNU bug report logs - #21087
24.5; ff-find-other-file will create a file with an extra trailling backslash

Previous Next

Package: emacs;

Reported by: ".." <akml <at> 163.com>

Date: Sat, 18 Jul 2015 17:20:02 UTC

Severity: minor

Found in version 24.5

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21087 in the body.
You can then email your comments to 21087 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21087; Package emacs. (Sat, 18 Jul 2015 17:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ".." <akml <at> 163.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 18 Jul 2015 17:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ".." <akml <at> 163.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; ff-find-other-file will create a file with an extra trailling
 backslash
Date: Sat, 18 Jul 2015 23:47:15 +0800 (CST)
[Message part 1 (text/plain, inline)]
Hi


It jumps out that ff-find-other-file will create the expecting file name with an extra
trailling backslash, which makes the the newly opened buffer as directory.
This happens after I updated all the 3rd party packages to the
latest version. Although I havn't found out which package caused this
issue, but the following patch will fix it, and I think it makes
more sense to use read-file-name than read-directory-name


--- emacs\share\emacs\24.5\lisp\find-file.el
+++ emacs\share\emacs\24.5\lisp\find-file.el
@@ -495,7 +495,7 @@
 
             (setq name
                   (expand-file-name
-                   (read-directory-name
+                   (read-file-name
                     (format "Find or create %s in: " default-name)
                     default-directory default-name nil)))








In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'


Important settings:
  value of $LANG: CHS
  locale-coding-system: cp936


Major mode: Emacs-Lisp


Minor modes in effect:
  recentf-mode: t
  clean-aindent-mode: t
  global-company-mode: t
  company-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-fci-mode: t
  fci-mode: t
  global-anzu-mode: t
  anzu-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  global-linum-mode: t
  linum-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  tooltip-mode: t
  electric-indent-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 messages:
Working...
Finding buffer pathname.cpp...
Finding ./pathname.cpp...
Finding /usr/include/pathname.cpp...
(New file)
Type "q" in help window to restore its previous buffer, C-M-v to scroll help.
C-x C-g is undefined
Quit
Mark set [4 times]
Mark saved where search started


Load-path shadows:
None found.


Features:
(shadow sort mail-extr emacsbug sendmail mm-archive message rfc822 mml
mml-sec mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode
mail-utils gnutls network-stream starttls url-http tls mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth
url-handlers finder-inf misearch multi-isearch find-file recentf
tree-widget wid-edit ido helm-command eieio-opt speedbar sb-image
ezimage dframe find-func winner helm-elisp helm-eval edebug eldoc vc-git
helm-gtags pulse which-func imenu ws-butler cc-langs cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
clean-aindent-mode company-files company-oddmuse company-keywords
company-etags etags company-gtags company-dabbrev-code company-dabbrev
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
company init-local init-org init-git init-yasnippet yasnippet cl
init-company init-editting fill-column-indicator anzu mule-util delsel
paren linum init-speedbar init-cc smart-tabs-mode init-helm helm-mode
helm-files rx tramp tramp-compat tramp-loaddefs trampver shell pcomplete
ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark
helm-adaptive helm-info bookmark pp helm-locate helm-match-plugin
helm-external helm-net browse-url xml url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source gnus-util mm-util mail-prsvr password-cache
url-vars mailcap helm-types helm-swoop helm-grep helm-regexp helm-plugin
helm-utils grep compile comint ansi-color ring helm-help helm cl-macs gv
helm-source eieio byte-opt bytecomp byte-compile cl-extra cconv
eieio-core helm-lib help-mode easy-mmode dired+ image-dired format-spec
image-file dired-x dired-aux dired helm-config helm-easymenu edmacro
kmacro async-bytecomp advice help-fns async helm-aliases cl-loaddefs
cl-lib init-dired+ init-elpa info easymenu package epg-config init-misc
leuven-theme init-proxy time-date china-util tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
w32-common-fns disp-table w32-win w32-vars 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 w32notify w32
multi-tty emacs)


Memory information:
((conses 8 363258 404536)
 (symbols 32 39646 66)
 (miscs 32 2070 6727)
 (strings 16 85062 231828)
 (string-bytes 1 2496192)
 (vectors 8 42179)
 (vector-slots 4 1604294 357330)
 (floats 8 652 1306)
 (intervals 28 3552 2997)
 (buffers 508 28))

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21087; Package emacs. (Sat, 18 Jul 2015 17:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 21087 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: ".." <akml <at> 163.com>
Cc: 21087 <at> debbugs.gnu.org
Subject: Re: bug#21087: 24.5;
 ff-find-other-file will create a file with an extra
 trailling	backslash
Date: Sat, 18 Jul 2015 20:40:52 +0300
> Date: Sat, 18 Jul 2015 23:47:15 +0800 (CST)
> From: ".." <akml <at> 163.com>
> 
> It jumps out that ff-find-other-file will create the expecting file name with
> an extra
> trailling backslash, which makes the the newly opened buffer as directory.
> This happens after I updated all the 3rd party packages to the
> latest version. Although I havn't found out which package caused this
> issue, but the following patch will fix it, and I think it makes
> more sense to use read-file-name than read-directory-name
> 
> --- emacs\share\emacs\24.5\lisp\find-file.el
> +++ emacs\share\emacs\24.5\lisp\find-file.el
> @@ -495,7 +495,7 @@
> (setq name
> (expand-file-name
> - (read-directory-name
> + (read-file-name
> (format "Find or create %s in: " default-name)
> default-directory default-name nil)))

But that question is about the directory in which to create a file, so
read-directory-name sounds about right to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21087; Package emacs. (Sun, 19 Jul 2015 02:45:03 GMT) Full text and rfc822 format available.

Message #11 received at 21087 <at> debbugs.gnu.org (full text, mbox):

From: ".." <akml <at> 163.com>
To: "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 21087 <at> debbugs.gnu.org
Subject: 回复:Re: bug#21087: 24.5; 	ff-find-other-file will create a file with an extra trailling	backslash
Date: Sun, 19 Jul 2015 10:44:01 +0800 (CST)
[Message part 1 (text/plain, inline)]
Hi Eli,


Yes, you are right, then why it calls read-directory-name with default-name as the DEFAULT-DIRNAME parameter while default-name is actually the name of the file to find. And the patch will come to this:


--- emacs\share\emacs\24.5\lisp\find-file.el
+++ emacs\share\emacs\24.5\lisp\find-file.el
@@ -497,7 +497,7 @@
                   (expand-file-name
                    (read-directory-name
                     (format "Find or create %s in: " default-name)
-                    default-directory default-name nil)))
+                    default-directory)))
 
             (setq pathname
                   (if (file-directory-p name)







At 2015-07-19 01:40:52, "Eli Zaretskii" <eliz <at> gnu.org> wrote:
>> Date: Sat, 18 Jul 2015 23:47:15 +0800 (CST)
>> From: ".." <akml <at> 163.com>
>> 
>> It jumps out that ff-find-other-file will create the expecting file name with
>> an extra
>> trailling backslash, which makes the the newly opened buffer as directory.
>> This happens after I updated all the 3rd party packages to the
>> latest version. Although I havn't found out which package caused this
>> issue, but the following patch will fix it, and I think it makes
>> more sense to use read-file-name than read-directory-name
>> 
>> --- emacs\share\emacs\24.5\lisp\find-file.el
>> +++ emacs\share\emacs\24.5\lisp\find-file.el
>> @@ -495,7 +495,7 @@
>> (setq name
>> (expand-file-name
>> - (read-directory-name
>> + (read-file-name
>> (format "Find or create %s in: " default-name)
>> default-directory default-name nil)))
>
>But that question is about the directory in which to create a file, so
>read-directory-name sounds about right to me.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21087; Package emacs. (Mon, 20 Jul 2015 15:33:02 GMT) Full text and rfc822 format available.

Message #14 received at 21087 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: akml <at> 163.com
Cc: 21087 <at> debbugs.gnu.org
Subject: Re: bug#21087: 24.5;
 ff-find-other-file will create a file with an extra trailling
 backslash
Date: Mon, 20 Jul 2015 11:32:14 -0400
".." wrote:

> It jumps out that ff-find-other-file will create the expecting file
> name with an extra trailling backslash, which makes the the newly
> opened buffer as directory.

Please give a minimal complete example starting from emacs -Q. Thanks.




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Wed, 12 Aug 2020 04:27:03 GMT) Full text and rfc822 format available.

Notification sent to ".." <akml <at> 163.com>:
bug acknowledged by developer. (Wed, 12 Aug 2020 04:27:03 GMT) Full text and rfc822 format available.

Message #19 received at 21087-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Glenn Morris <rgm <at> gnu.org>
Cc: akml <at> 163.com, 21087-done <at> debbugs.gnu.org
Subject: Re: bug#21087: 24.5; ff-find-other-file will create a file with an
 extra trailling backslash
Date: Tue, 11 Aug 2020 21:26:22 -0700
Glenn Morris <rgm <at> gnu.org> writes:

> ".." wrote:
>
>> It jumps out that ff-find-other-file will create the expecting file
>> name with an extra trailling backslash, which makes the the newly
>> opened buffer as directory.
>
> Please give a minimal complete example starting from emacs -Q. Thanks.

More information was requested, but none was given within 5 years, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Sep 2020 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.