]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix hfy-exclude-file-rules (bug#60562)
authorMattias Engdegård <mattiase@acm.org>
Sun, 15 Jan 2023 14:23:44 +0000 (15:23 +0100)
committerMattias Engdegård <mattiase@acm.org>
Mon, 16 Jan 2023 18:31:20 +0000 (19:31 +0100)
* lisp/htmlfontify.el (hfy-exclude-file-rules):
Fix broken defcustom type; no longer fails test-custom-opts.
Fix regexps not to use newline-sensitive patterns like `.` and `$`
which do not make sense when matching file names.
Better doc string.
* lisp/htmlfontify.el (hfy-list-files): Simplify regexp argument.

lisp/htmlfontify.el

index 0959405081fcf8987bee7abfc60529f95cda8cc7..1ab33cc641126e0b8921225b2b1c097cb4e5e5b8 100644 (file)
@@ -373,13 +373,13 @@ otherwise."
   :type  '(string))
 
 (defcustom hfy-exclude-file-rules
-  '("\\.flc$"
-    "/CVS/.*"
-    ".*~$"
-    "/\\.git\\(?:/.*\\)?$")
-  "Define some regular expressions to exclude files"
+  '("\\.flc\\'"
+    "/CVS/"
+    "~\\'"
+    "/\\.git\\(?:/\\|\\'\\)")
+  "Regular expressions matching files to exclude."
   :tag "exclude-rules"
-  :type '(list string)
+  :type '(repeat regexp)
   :version "29.1")
 
 (defcustom hfy-display-class nil
@@ -1835,7 +1835,7 @@ Strips any leading \"./\" from each filename."
                       (seq-some (lambda (r)
                                   (string-match r f))
                                 hfy-exclude-file-rules)))
-                (directory-files-recursively "." ".*" nil t)))
+                (directory-files-recursively "." "" nil t)))
 
 ;; strip the filename off, return a directory name
 ;; not a particularly thorough implementation, but it will be