all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#39672: 28.0.50; can't visit directory in Dired
@ 2020-02-19  2:52 Kan Sasaki
  2020-02-20  2:06 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Kan Sasaki @ 2020-02-19  2:52 UTC (permalink / raw)
  To: 39672

[-- Attachment #1: Type: Text/Plain, Size: 6062 bytes --]

In Dired, I can't visit directory which encoding is euc-jp.

When I type 'i' on the directory, emacs says 'Attempt to insert a
non-directory: DIRECTORY.' When I type 'RET' on the directory, emacs
says 'File exists, but cannot be read' and shows empty buffer.

This issue has occured since the following change:

9dc306b1db Improve reporting of I/O, access errors

I compared the files with the previous ones. I guess the attached
patch may fix this issue.


In GNU Emacs 28.0.50 (build 1, x86_64--freebsd, GTK+ Version 3.24.10, cairo version 1.16.0)
 of 2020-02-19 built on ayoki.noc.fcc.ad.jp
Repository revision: 2b04ca05ad9f3679a047ffc06b35d2d61d74b12e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: 12.1-STABLE

Recent messages:
Connecting to the POP server...
Opening a TCP connection ...
Connecting to the POP server...done
Communicating with the POP server...
Sending your POP password to the POP server...
No new messages
[2] is nil. C)reate D)up P)reserve F)indfile B)uff X)M-x k)KeyFunc&exit N)o:
Switch to window[2]
Memorize current window configuration into 2
Opening a TCP connection ...

Configured using:
 'configure amd64--freebsd --prefix=/home/sasaki/local/emacs
 --with-x-toolkit=gtk3 --without-xim --disable-acl 'CFLAGS=-O2 -pipe'
 'CPPFLAGS=-O2 -pipe' LDFLAGS='

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
KQUEUE GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER
LCMS2 GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: ja_JP.eucJP
  value of $XMODIFIERS: @im=uim
  locale-coding-system: japanese-iso-8bit-unix

Major mode: Lisp Interaction

Minor modes in effect:
  recentf-mode: t
  override-global-mode: t
  avy-migemo-mode: t
  global-ace-isearch-mode: t
  ace-isearch-mode: t
  helm-migemo-mode: t
  delete-selection-mode: t
  cua-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-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

Load-path shadows:
/home/sasaki/.emacs.d/elpa/28/magit-20200208.551/magit-section hides /home/sasaki/.emacs.d/elpa/28/magit-section-20200123.2235/magit-section
/home/sasaki/local/emacs/share/emacs/28.0.50/lisp/tempo hides /home/sasaki/.emacs.d/elisp/html-helper/OLD/tempo
/home/sasaki/.emacs.d/elisp/html-helper/html-helper-mode hides /home/sasaki/.emacs.d/elisp/html-helper/OLD/html-helper-mode

Features:
(shadow autoinsert emacsbug message rfc822 mml mml-sec epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search
time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail pp network-stream nsm rmc mew-varsx
mew-unix mail-utils c-sig mew-ical cal-menu calendar cal-loaddefs
rfc2047 rfc2045 mm-util mail-prsvr ietf-drums ht clearcite-mew
clearcite mew-w3m w3m mailcap doc-view jka-compr recentf-ext dired
dired-loaddefs image-mode exif timezone w3m-hist w3m-fb bookmark-w3m
w3m-ems w3m-favicon w3m-image tab-line w3m-proc w3m-util mew-auth
mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop mew-smtp
gnutls puny mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib
mew-ext mew-refile mew-demo mew-attach mew-draft mew-message
mew-thread mew-virtual mew-summary4 mew-summary3 mew-summary2
mew-summary mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq
mew-smime mew-pgp mew-header mew-exec mew-mark mew-mime mew-edit
mew-decode mew-encode mew-cache mew-minibuf mew-complete mew-addrbook
mew-local mew-vars3 mew-vars2 mew-vars mew-env mew-lang-jp mew-mule3
mew-mule mew-gemacs mew-key mew-func mew-blvs mew-const mew ccc s dash
helm-ag compile comint ansi-color windows revive web-mode disp-table
sgml-mode dom sync-recentf recentf tree-widget wid-edit diff-mode
dabbrev-highlight dabbrev use-package-bind-key bind-key avy-migemo
migemo avy ring ace-isearch helm-swoop helm-grep helm-regexp
format-spec helm-utils helm-help helm easy-mmode edmacro kmacro
helm-source eieio-compat helm-multi-match helm-lib async ace-jump-mode
cl cl-extra help-mode use-package-core atomic-chrome websocket
url-cookie url-domsuf url-util bindat let-alist server delsel cua-base
windmove utf-7 paren term/bobcat session finder-inf tex-site advice
w3m-load info package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib japan-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode
elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet
lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese composite charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded 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 threads dbusbind
kqueue lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
emacs)

Memory information:
((conses 16 375112 16620)
 (symbols 48 29028 1)
 (strings 32 130163 2393)
 (string-bytes 1 3826791)
 (vectors 16 38708)
 (vector-slots 8 605645 18128)
 (floats 8 130 23)
 (intervals 56 827 0)
 (buffers 1000 11))

[-- Attachment #2: fileio.c.diff --]
[-- Type: Text/X-Patch, Size: 1587 bytes --]

diff --git a/src/fileio.c b/src/fileio.c
index 87a17eab42..6b223e7078 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2924,16 +2924,18 @@ DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
 bool
 file_directory_p (Lisp_Object file)
 {
+  Lisp_Object encoded = ENCODE_FILE (file);
+
 #ifdef DOS_NT
   /* This is cheaper than 'stat'.  */
-  bool retval = faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0;
+  bool retval = faccessat (AT_FDCWD, SSDATA (encoded), D_OK, AT_EACCESS) == 0;
   if (!retval && errno == EACCES)
     errno = ENOTDIR;	/* like the non-DOS_NT branch below does */
   return retval;
 #else
 # ifdef O_PATH
   /* Use O_PATH if available, as it avoids races and EOVERFLOW issues.  */
-  int fd = emacs_openat (AT_FDCWD, SSDATA (file),
+  int fd = emacs_openat (AT_FDCWD, SSDATA (encoded),
 			 O_PATH | O_CLOEXEC | O_DIRECTORY, 0);
   if (0 <= fd)
     {
@@ -2950,12 +2952,12 @@ file_directory_p (Lisp_Object file)
      is inaccessible, fall back on fstatat; if the latter fails with
      EOVERFLOW then FILE must have been a directory unless a race
      condition occurred (a problem hard to work around portably).  */
-  if (file_accessible_directory_p (file))
+  if (file_accessible_directory_p (encoded))
     return true;
   if (errno != EACCES)
     return false;
   struct stat st;
-  if (emacs_fstatat (AT_FDCWD, SSDATA (file), &st, 0) != 0)
+  if (emacs_fstatat (AT_FDCWD, SSDATA (encoded), &st, 0) != 0)
     return errno == EOVERFLOW;
   if (S_ISDIR (st.st_mode))
     return true;

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

* bug#39672: 28.0.50; can't visit directory in Dired
  2020-02-19  2:52 bug#39672: 28.0.50; can't visit directory in Dired Kan Sasaki
@ 2020-02-20  2:06 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2020-02-20  2:06 UTC (permalink / raw)
  To: Kan Sasaki; +Cc: 39672-done

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

Thanks for reporting the bug. That is a regression in Emacs 27, and I 
reproduced the bug there, so I installed the attached patch (which is 
smaller and which I think is better) into the emacs-27 branch.

PS. Although I unfortunately mispelled your name in the attached file, I 
fixed the misspelling in the corresponding ChangeLog.3 file, which is 
what will be distributed in the next Emacs release. See:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-27&id=1d10885763287f03a5fb348ba27715e049bb48f8

[-- Attachment #2: 0001-Fix-bug-when-visiting-euc-jp-encoded-directories.patch --]
[-- Type: text/x-patch, Size: 988 bytes --]

From 62afbc513a4730c3352ffcee9f5cb9e1336c83e3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 19 Feb 2020 17:21:16 -0800
Subject: [PATCH] Fix bug when visiting euc-jp-encoded directories

Problem reported by Ken Sasaki (Bug#39672).
* src/fileio.c (Ffile_directory_p):
Encode filename before giving it to file_directory_p.
This fixes a typo introduced in
2019-09-18T02:18:14Z!eggert@cs.ucla.edu.
---
 src/fileio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fileio.c b/src/fileio.c
index 34934dd6df..482f88627a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2911,7 +2911,7 @@ DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
   if (!NILP (handler))
     return call2 (handler, Qfile_directory_p, absname);
 
-  return file_directory_p (absname) ? Qt : Qnil;
+  return file_directory_p (ENCODE_FILE (absname)) ? Qt : Qnil;
 }
 
 /* Return true if FILE is a directory or a symlink to a directory.
-- 
2.24.1


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

end of thread, other threads:[~2020-02-20  2:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-19  2:52 bug#39672: 28.0.50; can't visit directory in Dired Kan Sasaki
2020-02-20  2:06 ` Paul Eggert

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.