entered into RCS
authorJim Blandy <jimb@redhat.com>
Wed, 22 Jul 1992 16:15:36 +0000 (16:15 +0000)
committerJim Blandy <jimb@redhat.com>
Wed, 22 Jul 1992 16:15:36 +0000 (16:15 +0000)
src/dired.c
src/xselect.c.old

index e43620f..3beb9d1 100644 (file)
@@ -68,6 +68,7 @@ Lisp_Object Qcompletion_ignore_case;
 Lisp_Object Qdirectory_files;
 Lisp_Object Qfile_name_completion;
 Lisp_Object Qfile_name_all_completions;
+Lisp_Object Qfile_attributes;
 \f
 DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
   "Return a list of names of files in DIRECTORY.\n\
@@ -86,7 +87,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
 
   /* If the file name has special constructs in it,
      call the corresponding file handler.  */
-  handler = find_file_handler (filename);
+  handler = find_file_handler (dirname);
   if (!NILP (handler))
     {
       Lisp_Object args[6];
@@ -190,7 +191,7 @@ Returns nil if DIR contains no name starting with FILE.")
 
   /* If the file name has special constructs in it,
      call the corresponding file handler.  */
-  handler = find_file_handler (filename);
+  handler = find_file_handler (dirname);
   if (!NILP (handler))
     return call3 (handler, Qfile_name_completion, file, dirname);
 
@@ -208,7 +209,7 @@ These are all file names in directory DIR which begin with FILE.")
 
   /* If the file name has special constructs in it,
      call the corresponding file handler.  */
-  handler = find_file_handler (filename);
+  handler = find_file_handler (dirname);
   if (!NILP (handler))
     return call3 (handler, Qfile_name_all_completions, file, dirname);
 
@@ -505,6 +506,7 @@ syms_of_dired ()
   Qdirectory_files = intern ("directory-files");
   Qfile_name_completion = intern ("file-name-completion");
   Qfile_name_all_completions = intern ("file-name-all-completions");
+  Qfile_attributes = intern ("file-attributes");
 
   defsubr (&Sdirectory_files);
   defsubr (&Sfile_name_completion);
index cb76972..7123759 100644 (file)
@@ -193,11 +193,27 @@ use X selections.")
     }
   else if (EQ (type, Qcut_buffer0))
     {
+      /* DECwindows and some other servers don't seem to like setting
+        properties to values larger than about 20k.  For very large
+        values, they signal an error, but for intermediate values
+        they just seem to hang.
+
+        We could just truncate the request, but it's better to let
+        the user know that the strategy he/she's using isn't going to
+        work than to have it work partially, but incorrectly.  */
       BLOCK_INPUT;
-      XStoreBytes (x_current_display,
-                  (char *) XSTRING (string)->data,
-                  XSTRING (string)->size);
-      val = string;
+      if (XSTRING (string)->size > MAX_SELECTION (x_current_display))
+       {
+         XStoreBytes (x_current_display, (char *) 0, 0);
+         val = Qnil;
+       }
+      else
+       {
+         XStoreBytes (x_current_display,
+                      (char *) XSTRING (string)->data,
+                      XSTRING (string)->size);
+         val = string;
+       }
       UNBLOCK_INPUT;
     }
   else