all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: empty-directory predicate, native implementation
Date: Sat, 17 Oct 2020 21:03:24 +0200	[thread overview]
Message-ID: <VI1PR06MB45261F3309D31EC7DEDE4C8B96000@VI1PR06MB4526.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <871rhxp8we.fsf@gmx.de> (Michael Albinus's message of "Sat, 17 Oct 2020 10:13:37 +0200")

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

Michael Albinus <michael.albinus@gmx.de> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
> Hi Arthur,
>
>> I have patched handlers; which version should I make patches against:
>> current master or latest stable? How would you like patches; each in own
>> file?
>
> The patches shall be towards master. And I don't care, whether they are
> just one file, or several ones :-)
>
>> I will look at ert tests too.
>
> Thanks. Best regards, Michael.


[-- Attachment #2: directory-files.patch --]
[-- Type: text/x-patch, Size: 22847 bytes --]

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 3b8b4fb3a9..2f15176e79 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2917,7 +2917,7 @@ Contents of Directories
 the latter case, it can optionally display information about each file,
 depending on the options passed to the @code{ls} command.
 
-@defun directory-files directory &optional full-name match-regexp nosort
+@defun directory-files directory &optional full-name match-regexp nosort count
 This function returns a list of the names of the files in the directory
 @var{directory}.  By default, the list is in alphabetical order.
 
@@ -2937,6 +2937,13 @@ Contents of Directories
 are processed in.  If the order of processing is visible to the user,
 then the user will probably be happier if you do sort the names.
 
+If @var{count} is non-@code{nil}, the function will return first
+@var{count} number of files, or all files, whichever occurs
+first. @var{count} has to be a natural number (> 0). You can use this
+function to short circuit evaluation in case you are just interested to
+find if a directory is empty or not (request one file and tell it to
+ignore dot-files).
+
 @example
 @group
 (directory-files "~lewis")
@@ -2946,6 +2953,14 @@ Contents of Directories
 @end group
 @end example
 
+@example
+@group
+  (null (directory-files directory-name nil
+  "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*" t 1))
+     @result{} nil
+@end group
+@end example
+
 An error is signaled if @var{directory} is not the name of a directory
 that can be read.
 @end defun
@@ -2996,7 +3011,7 @@ Contents of Directories
 non-@code{nil} if that directory is the one it is looking for.
 @end defun
 
-@defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format
+@defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format count
 This is similar to @code{directory-files} in deciding which files
 to report on and how to report their names.  However, instead
 of returning a list of file names, it returns for each file a
diff --git a/etc/NEWS b/etc/NEWS
index 1838b6b38a..25c54d3dfe 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1550,6 +1550,13 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
 \f
 * Lisp Changes in Emacs 28.1
 
++++
+** 'diirectory-files' function can now take an additional count parameter
+This option makes directory-files return COUNT first files in
+directory. If match is given, the function vill return first COUNT files
+that match the expression. The option is useful for checking if
+directory is empty since it will check at most 3 files when COUNT = 1.
+
 +++
 ** 'truncate-string-ellipsis' now uses '…' by default.
 Modes that use 'truncate-string-to-width' with non-nil, non-string
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 0cb8d7cb83..335a07914c 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3427,8 +3427,8 @@ ange-ftp-file-accessible-directory-p
   (and (file-directory-p name)
        (file-readable-p name)))
 
-(defun ange-ftp-directory-files (directory &optional full match
-					   &rest v19-args)
+(defun ange-ftp-directory-files (directory &optional full match nosort
+					   count)
   (setq directory (expand-file-name directory))
   (if (ange-ftp-ftp-name directory)
       (progn
@@ -3444,18 +3444,19 @@ ange-ftp-directory-files
 		(setq files
 		      (cons (if full (concat directory f) f) files))))
 	  (nreverse files)))
-    (apply 'ange-ftp-real-directory-files directory full match v19-args)))
+    (apply 'ange-ftp-real-directory-files directory full match nosort count)))
 
 (defun ange-ftp-directory-files-and-attributes
-  (directory &optional full match nosort id-format)
+  (directory &optional full match nosort attrs id-format count)
   (setq directory (expand-file-name directory))
   (if (ange-ftp-ftp-name directory)
       (mapcar
        (lambda (file)
 	 (cons file (file-attributes (expand-file-name file directory))))
-       (ange-ftp-directory-files directory full match nosort))
+       (ange-ftp-directory-files directory full match nosort attrs
+                                 id_format count))
     (ange-ftp-real-directory-files-and-attributes
-     directory full match nosort id-format)))
+     directory full match nosort attrs id-format count)))
 
 (defun ange-ftp-file-attributes (file &optional id-format)
   (setq file (expand-file-name file))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 49ecaa58ee..26ec24a075 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -301,7 +301,7 @@ tramp-do-parse-file-attributes-with-ls
       file-properties)))
 
 (defun tramp-adb-handle-directory-files-and-attributes
-  (directory &optional full match nosort id-format)
+  (directory &optional full match nosort id-format count)
   "Like `directory-files-and-attributes' for Tramp files."
   (unless (file-exists-p directory)
     (tramp-error
@@ -312,7 +312,7 @@ tramp-adb-handle-directory-files-and-attributes
       (copy-tree
        (with-tramp-file-property
 	   v localname (format "directory-files-and-attributes-%s-%s-%s-%s"
-			       full match id-format nosort)
+			       full match id-format nosort count)
 	 (with-current-buffer (tramp-get-buffer v)
 	   (when (tramp-adb-send-command-and-check
 		  v (format "%s -a -l %s"
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 3e96daa7b1..bda3735db4 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -667,7 +667,10 @@ tramp-crypt-handle-delete-file
     (let (tramp-crypt-enabled)
       (delete-file (tramp-crypt-encrypt-file-name filename) trash))))
 
-(defun tramp-crypt-handle-directory-files (directory &optional full match nosort)
+;; This function does not seem to pass match and nosort into
+;; directory-files at all; is that intentional or bug?
+(defun tramp-crypt-handle-directory-files (directory &optional full
+                                                     match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
     (tramp-error
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 3701bfc22c..787eead807 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -300,8 +300,10 @@ tramp-rclone-handle-delete-file
     (tramp-flush-file-properties v localname)
     (tramp-rclone-flush-directory-cache v)))
 
+;; This function did not pass nosort arguemnt into directory-files
+;; not sure if intentional or bug
 (defun tramp-rclone-handle-directory-files
-    (directory &optional full match nosort)
+    (directory &optional full match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
     (tramp-error
@@ -312,7 +314,8 @@ tramp-rclone-handle-directory-files
     (with-parsed-tramp-file-name directory nil
       (let ((result
 	     (directory-files
-	      (tramp-rclone-local-file-name directory) full match)))
+	      (tramp-rclone-local-file-name directory) full match
+              nosort count)))
 	;; Massage the result.
 	(when full
 	  (let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 15eab0a4de..7a969979ac 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1701,9 +1701,9 @@ tramp-sh-handle-file-ownership-preserved-p
 		    (tramp-get-remote-gid v 'integer)))))))))
 
 ;; Directory listings.
-
+;; what about perl & sta -> need to fix list to count?
 (defun tramp-sh-handle-directory-files-and-attributes
-  (directory &optional full match nosort id-format)
+  (directory &optional full match nosort id-format count)
   "Like `directory-files-and-attributes' for Tramp files."
   (unless id-format (setq id-format 'integer))
   (unless (file-exists-p directory)
@@ -1743,7 +1743,7 @@ tramp-sh-handle-directory-files-and-attributes
 	    (sort result (lambda (x y) (string< (car x) (car y)))))
 	  ;; The scripts could fail, for example with huge file size.
 	  (tramp-handle-directory-files-and-attributes
-	   directory full match nosort id-format)))))
+	   directory full match nosort id-format count)))))
 
 (defun tramp-do-directory-files-and-attributes-with-perl
   (vec localname &optional id-format)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 1b6af2a2e3..62135f514d 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -690,29 +690,36 @@ tramp-smb-handle-delete-file
 	   v 'file-error "%s `%s'" (match-string 0) filename))))))
 
 (defun tramp-smb-handle-directory-files
-  (directory &optional full match nosort)
+  (directory &optional full match nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
     (tramp-error
      (tramp-dissect-file-name directory) tramp-file-missing
      "No such file or directory" directory))
-  (let ((result (mapcar #'directory-file-name
-			(file-name-all-completions "" directory))))
-    ;; Discriminate with regexp.
-    (when match
-      (setq result
-	    (delete nil
-		    (mapcar (lambda (x) (when (string-match-p match x) x))
-			    result))))
-    ;; Prepend directory.
-    (when full
-      (setq result
-	    (mapcar
-	     (lambda (x) (format "%s/%s" (directory-file-name directory) x))
-	     result)))
-    ;; Sort them if necessary.
-    (unless nosort (setq result (sort result #'string-lessp)))
-    result))
+  (let ((result nil)
+        (numres 0))
+    (when (or (not count) (> count 0))
+        (setq result (mapcar #'directory-file-name
+			     (file-name-all-completions "" directory)))
+      ;; Discriminate with regexp.
+      (when match
+        (setq result
+	      (delete nil
+		      (mapcar (lambda (x) (when (string-match-p match x) x))
+			      result))))
+
+      ;; return [0,count) number of results
+      (setq result (cl-subseq result 0 count))
+
+      ;; Prepend directory.
+      (when full
+        (setq result
+	      (mapcar
+	       (lambda (x) (format "%s/%s" (directory-file-name directory) x))
+	       result)))
+      ;; Sort them if necessary.
+      (unless nosort (setq result (sort result #'string-lessp)))
+      result)))
 
 (defun tramp-smb-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files."
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6d44ad23ad..a99af70196 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3114,7 +3114,8 @@ tramp-handle-directory-file-name
     (setq directory (substring directory 0 -1)))
   directory)
 
-(defun tramp-handle-directory-files (directory &optional full match nosort)
+(defun tramp-handle-directory-files (directory &optional full match
+                                               nosort count)
   "Like `directory-files' for Tramp files."
   (unless (file-exists-p directory)
     (tramp-error
@@ -3133,13 +3134,13 @@ tramp-handle-directory-files
       (if nosort result (sort result #'string<)))))
 
 (defun tramp-handle-directory-files-and-attributes
-  (directory &optional full match nosort id-format)
+  (directory &optional full match nosort id-format count)
   "Like `directory-files-and-attributes' for Tramp files."
   (mapcar
    (lambda (x)
      (cons x (file-attributes
 	      (if full x (expand-file-name x directory)) id-format)))
-   (directory-files directory full match nosort)))
+   (directory-files directory full match nosort count)))
 
 (defun tramp-handle-dired-uncache (dir)
   "Like `dired-uncache' for Tramp files."
diff --git a/src/dired.c b/src/dired.c
index 1584b6acf0..1fc8dd27fa 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -17,7 +17,6 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
-
 #include <config.h>
 
 #include <sys/stat.h>
@@ -165,8 +164,26 @@ read_dirent (DIR *dir, Lisp_Object dirname)
 Lisp_Object
 directory_files_internal (Lisp_Object directory, Lisp_Object full,
 			  Lisp_Object match, Lisp_Object nosort, bool attrs,
-			  Lisp_Object id_format)
+			  Lisp_Object id_format, Lisp_Object return_count)
 {
+  ptrdiff_t ind = 0, last = 0;
+
+  /* check count first for early exit */
+  if (FIXNUMP(return_count))
+    {
+      last = XFIXNUM (return_count);
+      if (last <= 0)
+        return Qnil;
+    }
+
+  if (FIXNATP(return_count))
+    {
+      last = XFIXNAT(return_count);
+
+      if (!last)
+        return Qnil;
+    }
+
   if (!NILP (match))
     CHECK_STRING (match);
 
@@ -267,6 +284,10 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
       else
 	finalname = name;
 
+      if (last && ind == last)
+          break;
+      ind ++;
+
       list = Fcons (attrs ? Fcons (finalname, fileattrs) : finalname, list);
     }
 
@@ -287,8 +308,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
   return list;
 }
 
-
-DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
+DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 5, 0,
        doc: /* Return a list of names of files in DIRECTORY.
 There are three optional arguments:
 If FULL is non-nil, return absolute file names.  Otherwise return names
@@ -296,9 +316,12 @@ DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
 If MATCH is non-nil, mention only file names that match the regexp MATCH.
 If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
  Otherwise, the list returned is sorted with `string-lessp'.
- NOSORT is useful if you plan to sort the result yourself.  */)
+ NOSORT is useful if you plan to sort the result yourself.
+If COUNT is  non-nil, the function will return max of COUNT and length
+ files, where length is number of files in the directory. COUNT has to
+ be a natural number > 0. */)
   (Lisp_Object directory, Lisp_Object full, Lisp_Object match,
-   Lisp_Object nosort)
+   Lisp_Object nosort, Lisp_Object count)
 {
   directory = Fexpand_file_name (directory, Qnil);
 
@@ -306,34 +329,38 @@ DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
      call the corresponding file name handler.  */
   Lisp_Object handler = Ffind_file_name_handler (directory, Qdirectory_files);
   if (!NILP (handler))
-    return call5 (handler, Qdirectory_files, directory,
-                  full, match, nosort);
+    return call6 (handler, Qdirectory_files, directory,
+                  full, match, nosort, count);
 
-  return directory_files_internal (directory, full, match, nosort, false, Qnil);
+  return directory_files_internal (directory, full, match, nosort,
+                                   false, Qnil, count);
 }
 
 DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes,
-       Sdirectory_files_and_attributes, 1, 5, 0,
-       doc: /* Return a list of names of files and their attributes in DIRECTORY.
+       Sdirectory_files_and_attributes, 1, 6, 0, doc
+       : /* Return a list of names of files and their attributes in DIRECTORY.
 Value is a list of the form:
 
-  ((FILE1 . FILE1-ATTRS) (FILE2 . FILE2-ATTRS) ...)
+((FILE1 . FILE1-ATTRS) (FILE2 . FILE2-ATTRS) ...)
 
 where each FILEn-ATTRS is the attributes of FILEn as returned
 by `file-attributes'.
 
 This function accepts four optional arguments:
 If FULL is non-nil, return absolute file names.  Otherwise return names
- that are relative to the specified directory.
+that are relative to the specified directory.
 If MATCH is non-nil, mention only file names that match the regexp MATCH.
 If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
- NOSORT is useful if you plan to sort the result yourself.
+NOSORT is useful if you plan to sort the result yourself.
 ID-FORMAT specifies the preferred format of attributes uid and gid, see
 `file-attributes' for further documentation.
 On MS-Windows, performance depends on `w32-get-true-file-attributes',
-which see.  */)
-  (Lisp_Object directory, Lisp_Object full, Lisp_Object match,
-   Lisp_Object nosort, Lisp_Object id_format)
+which see.
+If COUNT is  non-nil, the function will return max of COUNT and length
+ files, where length is number of files in the directory. COUNT has to
+ be a natural number > 0. */)
+(Lisp_Object directory, Lisp_Object full, Lisp_Object match,
+ Lisp_Object nosort, Lisp_Object id_format, Lisp_Object count)
 {
   directory = Fexpand_file_name (directory, Qnil);
 
@@ -342,11 +369,11 @@ DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes,
   Lisp_Object handler
     = Ffind_file_name_handler (directory, Qdirectory_files_and_attributes);
   if (!NILP (handler))
-    return call6 (handler, Qdirectory_files_and_attributes,
-                  directory, full, match, nosort, id_format);
+    return call7 (handler, Qdirectory_files_and_attributes,
+                  directory, full, match, nosort, id_format, count);
 
   return directory_files_internal (directory, full, match, nosort,
-				   true, id_format);
+				   true, id_format, count);
 }
 
 \f
diff --git a/src/lisp.h b/src/lisp.h
index 45353fbef3..a3cfb5044d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4612,7 +4612,7 @@ maybe_disable_address_randomization (int argc, char **argv)
 extern void syms_of_dired (void);
 extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
                                              Lisp_Object, Lisp_Object,
-                                             bool, Lisp_Object);
+                                             bool, Lisp_Object, Lisp_Object);
 
 /* Defined in term.c.  */
 extern int *char_ins_del_vector;
diff --git a/src/sysdep.c b/src/sysdep.c
index f6c0ddee01..9111f1863e 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2892,7 +2892,7 @@ list_system_processes (void)
      process.  */
   procdir = build_string ("/proc");
   match = build_string ("[0-9]+");
-  proclist = directory_files_internal (procdir, Qnil, match, Qt, false, Qnil);
+  proclist = directory_files_internal (procdir, Qnil, match, Qt, false, Qnil, Qnil);
 
   /* `proclist' gives process IDs as strings.  Destructively convert
      each string into a number.  */
diff --git a/test/src/dired-tests.el b/test/src/dired-tests.el
new file mode 100644
index 0000000000..3b739e59cc
--- /dev/null
+++ b/test/src/dired-tests.el
@@ -0,0 +1,92 @@
+;;; dired-tests.el --- Tests for directory-files in dired.c  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+
+;; Author: Arthur Miller <arthur.miller@live.com>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+(require 'ert)
+
+(ert-deftest directory-files-tests ()
+  (let ((name (expand-file-name "directory-files-test"
+                                (temporary-file-directory)))
+        ;; nodots expression from dired+ by Drew A.
+        (nodots "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
+
+    (message name)
+    (when (file-directory-p name)
+      (delete-directory name t))
+    (make-directory name)
+    (when (file-directory-p name)
+      (should (= 2 (length (directory-files name))))
+      (should-not (directory-files name nil nodots t 1))
+      (dolist (file '(a b c d))
+        (make-empty-file (expand-file-name (symbol-name file) name)))
+      (should (= 6 (length (directory-files name))))
+      (should (equal "abcd" (string-join (directory-files name nil
+                                                          nodots) "")))
+      (should (= 2 (length (directory-files name nil "[bc]"))))
+      (should (= 3 (length (directory-files name nil nodots nil 3))))
+      (dolist (file '(5 4 3 2 1))
+        (make-empty-file (expand-file-name (number-to-string file) name)))
+      (should (= 0 (length (directory-files name nil "[0-9]" t -1))))
+      (should (= 5 (length (directory-files name nil "[0-9]" t))))
+      (should (= 5 (length (directory-files name nil "[0-9]" t 50))))
+  )))
+
+(ert-deftest directory-files-and-attributes-tests ()
+  (let ((name (expand-file-name "directory-files-test"
+                                (temporary-file-directory)))
+        ;; nodots expression from dired+ by Drew A.
+        (nodots "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
+
+    (message name)
+    (when (file-directory-p name)
+      (delete-directory name t))
+    (make-directory name)
+    (when (file-directory-p name)
+      (should (= 2 (length (directory-files name))))
+      (should-not (directory-files-and-attributes name t nodots t 1))
+      (dolist (file '(a b c d))
+        (make-directory (expand-file-name (symbol-name file) name)))
+      (should (= 6 (length (directory-files-and-attributes name))))
+      (dolist (dir (directory-files-and-attributes name t nodots))
+        (should (file-directory-p (car dir)))
+        (should-not (file-regular-p (car dir))))
+      (should (= 2 (length
+                    (directory-files-and-attributes name nil "[bc]"))))
+      (should (= 3 (length
+                    (directory-files-and-attributes name nil nodots
+                                                    nil nil 3))))
+      (dolist (file '(5 4 3 2 1))
+        (make-empty-file (expand-file-name (number-to-string file) name)))
+      (should (= 0 (length
+                    (directory-files-and-attributes name nil
+                                                    "[0-9]" t 1 -1))))
+      (should (= 5 (length
+                    (directory-files-and-attributes name nil "[0-9]" t))))
+      (should (= 5 (length
+                    (directory-files-and-attributes name nil
+                                                    "[0-9]" t nil 50))))
+      )))
+
+(provide 'dired-tests)
+;;; dired-tests.el ends here

[-- Attachment #3: Type: text/plain, Size: 877 bytes --]


See how this works.I have done patch between two branches.

Please check that handlers stuff. I am not sure how to test it, and am
not sure I get those correct; especially tramp-crypt.

I am using a regular expression from Dired+ by Drew in two places. I
have mention it the comment in ert tests, but don't know how to mention
it in the example in manual. Maybe remove example, or maybe it can stay
without creds?

I also discovered that I wasn't covered with FIXNUM all the way; thought
it was unsigned int so -1 would be converted into ffffffff, which
would just yeild all results. Seems like fixnum is not what I thought so I
have added test for <=0 which return nil.

Ert test are mostly foxused on new argument. I haven't found something
related to dired in test/src so I have created dired-tests.el. If it
shoudl be in some other place I can rename it.

Best regards
/a

  reply	other threads:[~2020-10-17 19:03 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13  2:22 empty-directory predicate, native implementation Arthur Miller
2020-10-13  8:01 ` Michael Albinus
2020-10-13 11:42   ` Arthur Miller
2020-10-13 13:16     ` Michael Albinus
2020-10-13 18:32       ` Arthur Miller
2020-10-13 18:39         ` Michael Albinus
2020-10-13 23:20           ` Arthur Miller
2020-10-14  9:19             ` Michael Albinus
2020-10-14 13:53               ` Arthur Miller
2020-10-13 14:48 ` Eli Zaretskii
2020-10-13 18:43   ` Arthur Miller
2020-10-13 19:12     ` Eli Zaretskii
2020-10-13 19:59       ` Arthur Miller
2020-10-14 14:08         ` Eli Zaretskii
2020-10-14 14:43           ` Arthur Miller
2020-10-13 18:44   ` Michael Albinus
2020-10-13 19:14     ` Eli Zaretskii
2020-10-13 20:08       ` Arthur Miller
2020-10-14  1:52       ` Arthur Miller
2020-10-14  9:21         ` Michael Albinus
2020-10-14 13:56           ` Arthur Miller
2020-10-14 14:41             ` Michael Albinus
2020-10-14 15:07               ` Arthur Miller
2020-10-14 15:53                 ` Michael Albinus
2020-10-14 16:12                   ` Eli Zaretskii
2020-10-14 16:21                     ` Michael Albinus
2020-10-14 16:29                       ` Eli Zaretskii
2020-10-15  5:53                         ` Arthur Miller
2020-10-15  9:12                           ` Michael Albinus
2020-10-15 11:33                             ` Arthur Miller
2020-10-15 12:21                               ` Michael Albinus
2020-10-15 13:29                                 ` Arthur Miller
2020-10-15 14:01                                 ` Arthur Miller
2020-10-15 14:41                                   ` Michael Albinus
2020-10-15 15:22                                     ` Arthur Miller
2020-10-16 23:31                                 ` Arthur Miller
2020-10-17  8:13                                   ` Michael Albinus
2020-10-17 19:03                                     ` Arthur Miller [this message]
2020-10-17 20:03                                       ` Drew Adams
2020-10-17 20:27                                         ` Arthur Miller
2020-10-17 21:18                                           ` Drew Adams
2020-10-17 22:06                                             ` Arthur Miller
2020-10-17 21:02                                         ` Arthur Miller
2020-10-17 21:27                                           ` Drew Adams
2020-10-17 21:58                                             ` Arthur Miller
2020-10-18 12:06                                               ` Michael Albinus
2020-10-18  2:47                                         ` Eli Zaretskii
2020-10-18 11:52                                       ` Michael Albinus
2020-10-18 16:15                                         ` Drew Adams
2020-10-18 16:43                                           ` Michael Albinus
2020-10-18 20:15                                           ` Stefan Monnier
2020-10-18 21:25                                             ` Drew Adams
2020-10-19  0:03                                           ` Arthur Miller
2020-10-18 22:21                                         ` Arthur Miller
2020-10-19  8:04                                           ` Michael Albinus
2020-10-19 14:01                                             ` Arthur Miller
2020-10-19 14:50                                               ` Michael Albinus
     [not found]                                         ` <VI1PR06MB45266BE5DFC72AEB27567A6C961E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                           ` <87a6wixoim.fsf@gmx.de>
     [not found]                                             ` <VI1PR06MB4526280D5B81531D06E58BC1961D0@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                               ` <87wnzev6i3.fsf@gmx.de>
     [not found]                                                 ` <VI1PR06MB45264E1CB34EECE86672581C96100@VI1PR06MB4526.eurprd06.prod.outlook.com>
2020-11-02 17:02                                                   ` Michael Albinus
2020-11-03 15:20                                                     ` Arthur Miller
2020-10-15 13:38                               ` Stefan Monnier
2020-10-16 23:33                                 ` Arthur Miller
2020-10-14 14:49             ` Arthur Miller
     [not found] <<VI1PR06MB4526ACBABDE795DDD49A5A5896040@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found] ` <<83y2ka18t7.fsf@gnu.org>
     [not found]   ` <<87y2kaj799.fsf@gmx.de>
     [not found]     ` <<83blh60wgr.fsf@gnu.org>
     [not found]       ` <<VI1PR06MB452688C9C71D5463D9497A2A96050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]         ` <<87h7qxjh7g.fsf@gmx.de>
     [not found]           ` <<VI1PR06MB45269B3924B44A555428F00596050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]             ` <<878sc8kgy8.fsf@gmx.de>
     [not found]               ` <<VI1PR06MB4526FDD3D3EB4867AF837C8F96050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                 ` <<87imbcls71.fsf@gmx.de>
     [not found]                   ` <<83eem0zt0b.fsf@gnu.org>
     [not found]                     ` <<87k0vsrd6m.fsf@gmx.de>
     [not found]                       ` <<83a6wozs7h.fsf@gnu.org>
     [not found]                         ` <<VI1PR06MB45267C7D83E77C3F307FF34E96020@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                           ` <<87sgafq2e2.fsf@gmx.de>
     [not found]                             ` <<AM6PR06MB4518BCD25B93987390D7D6D596020@AM6PR06MB4518.eurprd06.prod.outlook.com>
     [not found]                               ` <<87h7qvptm3.fsf@gmx.de>
     [not found]                                 ` <<VI1PR06MB452605D66CDE84BAA25A257696030@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                   ` <<871rhxp8we.fsf@gmx.de>
     [not found]                                     ` <<VI1PR06MB45261F3309D31EC7DEDE4C8B96000@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                       ` <<237bd21b-96c7-4433-a5bc-34b64a9f4250@default>
     [not found]                                         ` <<83ft6cs10u.fsf@gnu.org>
2020-10-18  4:05                                           ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2020-10-18 21:13 Drew Adams
2020-10-18 22:15 ` Stefan Monnier
2020-10-19  7:54   ` Michael Albinus
2020-10-19  0:24 ` Arthur Miller
2020-10-19  0:37   ` Drew Adams
2020-10-19  2:15     ` Arthur Miller
2020-10-19  7:51 ` Michael Albinus
2020-10-19 15:25   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR06MB45261F3309D31EC7DEDE4C8B96000@VI1PR06MB4526.eurprd06.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.