aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-gitignore.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-08-22 20:55:38 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-08-22 20:55:38 +0200
commit1c48327a067c41f78f35cc65bdbf3067f1d3d25d (patch)
tree2d93943ac31df9274f0b97030e4c1cdd1a753047 /lisp/magit-gitignore.el
parentfc69a08eb04af57b55d4f02b1dfe218daaa9b36a (diff)
Use Cond-Let's and$
Anaphoric macros get a bad rep and while my own infatuation was somewhat short lived, there are cases where I still find them useful, such as in the case of (and$ (function-with-a-name-that-makes-if-obvious-what-is-returned) (function-with-a-name-that-makes-if-obvious-what-is-expected $)) Many of the cases where this commits starts using `and$', fall squarely into that category. There are a few where I an on the fence. That's because I've just invented this macro and need some practice to fully develop my sense of when it is, and is not, appropriate to use this macro.
Diffstat (limited to 'lisp/magit-gitignore.el')
-rw-r--r--lisp/magit-gitignore.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el
index 9bf0bfa..ef2bc7a 100644
--- a/lisp/magit-gitignore.el
+++ b/lisp/magit-gitignore.el
@@ -118,9 +118,9 @@ Rules that are defined in that file affect all local repositories."
(mapcan
(lambda (file)
(cons (concat "/" file)
- (and-let ((ext (file-name-extension file)))
- (list (concat "/" (file-name-directory file) "*." ext)
- (concat "*." ext)))))
+ (and$ (file-name-extension file)
+ (list (concat "/" (file-name-directory file) "*." $)
+ (concat "*." $)))))
(sort (nconc
(magit-untracked-files nil base)
;; The untracked section of the status buffer lists