Skip to content

Commit 524c02d

Browse files
committed
fix: Avoid patching compat functions
1 parent 14d2a48 commit 524c02d

File tree

16 files changed

+58
-60
lines changed

16 files changed

+58
-60
lines changed

lisp/core/compile.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
;;
2323
;;; Flags
2424

25-
(advice-add #'eask-allow-error-p :override #'always)
25+
(advice-add #'eask-allow-error-p :override #'eask-always)
2626

2727
;;
2828
;;; Handle options

lisp/create/elpa.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
(goto-char (point-min))
3131
(search-forward "(script ")
3232
(forward-line 1)
33-
(dolist (gitkeeps (directory-files-recursively eask-file-root ".gitkeep"))
33+
(dolist (gitkeeps (eask-directory-files-recursively eask-file-root ".gitkeep"))
3434
(ignore-errors (delete-file gitkeeps)))
3535
;; --- Start insertion
3636
(insert "(script \"build\" \"eask exec github-elpa build\")\n")

lisp/extern/compat.el

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,51 @@
22
;;; Commentary:
33
;;; Code:
44

5-
(eask-defvc< 27
6-
(defun directory-files-recursively (dir regexp
5+
;; XXX: Support after Emacs 27.1
6+
(defun eask-directory-files-recursively ( dir regexp
77
&optional include-directories predicate
88
follow-symlinks)
9-
"..."
10-
(let* ((result nil)
11-
(files nil)
12-
(dir (directory-file-name dir))
13-
;; When DIR is "/", remote file names like "/method:" could
14-
;; also be offered. We shall suppress them.
15-
(tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
16-
(dolist (file (sort (file-name-all-completions "" dir)
17-
'string<))
18-
(unless (member file '("./" "../"))
19-
(if (directory-name-p file)
20-
(let* ((leaf (substring file 0 (1- (length file))))
21-
(full-file (concat dir "/" leaf)))
22-
;; Don't follow symlinks to other directories.
23-
(when (and (or (not (file-symlink-p full-file))
24-
(and (file-symlink-p full-file)
25-
follow-symlinks))
26-
;; Allow filtering subdirectories.
27-
(or (eq predicate nil)
28-
(eq predicate t)
29-
(funcall predicate full-file)))
30-
(let ((sub-files
31-
(if (eq predicate t)
32-
(ignore-error file-error
33-
(directory-files-recursively
34-
full-file regexp include-directories
35-
predicate follow-symlinks))
36-
(directory-files-recursively
37-
full-file regexp include-directories
38-
predicate follow-symlinks))))
39-
(setq result (nconc result sub-files))))
40-
(when (and include-directories
41-
(string-match regexp leaf))
42-
(setq result (nconc result (list full-file)))))
43-
(when (string-match regexp file)
44-
(push (concat dir "/" file) files)))))
45-
(nconc result (nreverse files)))))
9+
"..."
10+
(let* ((result nil)
11+
(files nil)
12+
(dir (directory-file-name dir))
13+
;; When DIR is "/", remote file names like "/method:" could
14+
;; also be offered. We shall suppress them.
15+
(tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
16+
(dolist (file (sort (file-name-all-completions "" dir)
17+
'string<))
18+
(unless (member file '("./" "../"))
19+
(if (directory-name-p file)
20+
(let* ((leaf (substring file 0 (1- (length file))))
21+
(full-file (concat dir "/" leaf)))
22+
;; Don't follow symlinks to other directories.
23+
(when (and (or (not (file-symlink-p full-file))
24+
(and (file-symlink-p full-file)
25+
follow-symlinks))
26+
;; Allow filtering subdirectories.
27+
(or (eq predicate nil)
28+
(eq predicate t)
29+
(funcall predicate full-file)))
30+
(let ((sub-files
31+
(if (eq predicate t)
32+
(ignore-error file-error
33+
(eask-directory-files-recursively
34+
full-file regexp include-directories
35+
predicate follow-symlinks))
36+
(eask-directory-files-recursively
37+
full-file regexp include-directories
38+
predicate follow-symlinks))))
39+
(setq result (nconc result sub-files))))
40+
(when (and include-directories
41+
(string-match regexp leaf))
42+
(setq result (nconc result (list full-file)))))
43+
(when (string-match regexp file)
44+
(push (concat dir "/" file) files)))))
45+
(nconc result (nreverse files))))
4646

47-
(eask-defvc< 28
48-
(defun always (&rest _arguments)
49-
"Ignore ARGUMENTS, do nothing, and return t.
50-
This function accepts any number of arguments in ARGUMENTS.
51-
Also see `ignore'."
52-
t))
47+
;; XXX: Support after Emacs 28.1
48+
(defun eask-always (&rest _arguments)
49+
"..."
50+
t)
5351

5452
;;; extern/compat.el ends here

lisp/format/elfmt.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
;;
2828
;;; Flags
2929

30-
(advice-add #'eask-allow-error-p :override #'always)
30+
(advice-add #'eask-allow-error-p :override #'eask-always)
3131

3232
;;
3333
;;; Core

lisp/format/elisp-autofmt.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
(eask-command-check "29.1")
3131

32-
(advice-add #'eask-allow-error-p :override #'always)
32+
(advice-add #'eask-allow-error-p :override #'eask-always)
3333

3434
;;
3535
;;; Core

lisp/lint/checkdoc.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
;;
3131
;;; Flags
3232

33-
(advice-add #'eask-allow-error-p :override #'always)
33+
(advice-add #'eask-allow-error-p :override #'eask-always)
3434

3535
;;
3636
;;; Core

lisp/lint/declare.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
;;
2828
;;; Flags
2929

30-
(advice-add #'eask-allow-error-p :override #'always)
30+
(advice-add #'eask-allow-error-p :override #'eask-always)
3131

3232
;;
3333
;;; Core

lisp/lint/elint.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
;;
2828
;;; Flags
2929

30-
(advice-add #'eask-allow-error-p :override #'always)
30+
(advice-add #'eask-allow-error-p :override #'eask-always)
3131

3232
;;
3333
;;; Core

lisp/lint/elisp-lint.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
;;
2828
;;; Flags
2929

30-
(advice-add #'eask-allow-error-p :override #'always)
30+
(advice-add #'eask-allow-error-p :override #'eask-always)
3131

3232
;;
3333
;;; Core

lisp/lint/elsa.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
;;
3434
;;; Flags
3535

36-
(advice-add #'eask-allow-error-p :override #'always)
36+
(advice-add #'eask-allow-error-p :override #'eask-always)
3737

3838
;;
3939
;;; Core

0 commit comments

Comments
 (0)