[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: directory-files and KANJI file name.



堀口です. 自己解決しました. directory-files で生(SJIS)のディレク
  トリ名で regexp とマッチングをとっているのが原因でした.

   よって "^腰" では "腰が痛い" にはマッチングしていませんでした.

   添付のパッチのようにすることで現象は直りました.
--
堀口恭太郎.
*** org/Meadow/src/dired.c	Mon Jan 12 08:20:01 1998
--- Meadow/src/dired.c	Fri Apr 24 21:15:51 1998
***************
*** 197,237 ****
    while (1)
      {
        DIRENTRY *dp = readdir (d);
        int len;
  
        if (!dp) break;
        len = NAMLEN (dp);
        if (DIRENTRY_NONEMPTY (dp))
  	{
  	  if (NILP (match)
! 	      || (0 <= re_search (bufp, dp->d_name, len, 0, len, 0)))
  	    {
  	      if (!NILP (full))
  		{
! 		  int afterdirindex = dirnamelen;
! 		  int total = len + dirnamelen;
  		  int needsep = 0;
  
  		  /* Decide whether we need to add a directory separator.  */
  #ifndef VMS
! 		  if (dirnamelen == 0
! 		      || !IS_ANY_SEP (XSTRING (encoded_directory)->data[dirnamelen - 1]))
  		    needsep = 1;
  #endif /* VMS */
  
  		  name = make_uninit_string (total + needsep);
! 		  bcopy (XSTRING (encoded_directory)->data, XSTRING (name)->data,
! 			 dirnamelen);
  		  if (needsep)
  		    XSTRING (name)->data[afterdirindex++] = DIRECTORY_SEP;
! 		  bcopy (dp->d_name,
! 			 XSTRING (name)->data + afterdirindex, len);
  		}
  	      else
! 		name = make_string (dp->d_name, len);
! 	      if (! NILP (Vfile_name_coding_system))
! 		name = Fdecode_coding_string (name, Vfile_name_coding_system,
! 					      Qt);
  	      list = Fcons (name, list);
  	    }
  	}
--- 197,240 ----
    while (1)
      {
        DIRENTRY *dp = readdir (d);
+       Lisp_Object fname;
        int len;
  
        if (!dp) break;
        len = NAMLEN (dp);
+       fname=make_string(dp->d_name, len);
+       if (! NILP (Vfile_name_coding_system))
+ 	fname = Fdecode_coding_string (fname, Vfile_name_coding_system, Qt);
        if (DIRENTRY_NONEMPTY (dp))
  	{
  	  if (NILP (match)
! 	      || (0 <= re_search (bufp, XSTRING (fname)->data, len, 0, len, 0)))
  	    {
  	      if (!NILP (full))
  		{
! 		  int encoded_len = XSTRING (fname)->size;
! 		  int encoded_dirnamelen = XSTRING (directory)->size;
! 		  int afterdirindex = encoded_dirnamelen;
! 		  int total = encoded_len + afterdirindex;
  		  int needsep = 0;
  
  		  /* Decide whether we need to add a directory separator.  */
  #ifndef VMS
! 		  if (encoded_dirnamelen == 0
! 		      || !IS_ANY_SEP (XSTRING (encoded_directory)->data[encoded_dirnamelen - 1]))
  		    needsep = 1;
  #endif /* VMS */
  
  		  name = make_uninit_string (total + needsep);
! 		  bcopy (XSTRING (directory)->data, XSTRING (name)->data,
! 			 encoded_dirnamelen);
  		  if (needsep)
  		    XSTRING (name)->data[afterdirindex++] = DIRECTORY_SEP;
! 		  bcopy (XSTRING (fname)->data,
! 			 XSTRING (name)->data + afterdirindex, encoded_len);
  		}
  	      else
! 		name = fname;
  	      list = Fcons (name, list);
  	    }
  	}