@@ -281,7 +281,7 @@ If DIR is non-nil, the function returns a flake at or above the
281
281
directory. It implies LOCAL."
282
282
(or (unless (or local dir)
283
283
nix3-flake-url)
284
- (if-let ( root (locate-dominating-file (or dir default-directory) " flake.nix" ))
284
+ (if-let* (( root (locate-dominating-file (or dir default-directory) " flake.nix" ) ))
285
285
(nix3-normalize-path root)
286
286
(unless allow-missing
287
287
(error " No flake.nix is found " )))))
@@ -324,12 +324,12 @@ directory. It implies LOCAL."
324
324
(pcase \. type
325
325
(" indirect"
326
326
(require 'nix3-registry )
327
- (if-let (entry (thread-last
327
+ (if-let* ( (entry (thread-last
328
328
(nix3-registry--collect-entries)
329
329
(cl-remove-if (lambda (x )
330
330
(equal (cdr (assq 'type (cddr x)))
331
331
" path" )))
332
- (assoc \. id)))
332
+ (assoc \. id))))
333
333
(to-url (cddr entry))
334
334
(error " Failed to find a registry entry for %s " \. id)))
335
335
(" github"
@@ -445,7 +445,7 @@ directory. It implies LOCAL."
445
445
type)
446
446
result))
447
447
(" unknown"
448
- (when-let ( match (seq-find (apply-partially #'prefixp path) extra-derivations))
448
+ (when-let* (( match (seq-find (apply-partially #'prefixp path) extra-derivations) ))
449
449
(let ((rest (seq-drop match (length path))))
450
450
(go2 path rest))))))
451
451
(go2 (path rest)
@@ -510,7 +510,7 @@ directory. It implies LOCAL."
510
510
511
511
(defun nix3-flake-insert-metadata ()
512
512
(magit-insert-section (flake-metadata nil )
513
- (when-let ( metadata (nix3-flake--get-metadata-result))
513
+ (when-let* (( metadata (nix3-flake--get-metadata-result) ))
514
514
(let-alist metadata
515
515
(nix3-section-dlist 0
516
516
nil
@@ -539,14 +539,14 @@ directory. It implies LOCAL."
539
539
540
540
(defun nix3-flake-output-return ()
541
541
(interactive )
542
- (when-let ( output (nix3-flake-output-path-at-point))
542
+ (when-let* (( output (nix3-flake-output-path-at-point) ))
543
543
(setq nix3-transient-flake (nix3-flake--buffer-url))
544
544
(setq nix3-transient-flake-output output)
545
545
(setq nix3-transient-flake-output-type (nix3-flake-output-type))
546
546
(nix3-transient-on-output)))
547
547
548
548
(defun nix3-flake-output-path-at-point ()
549
- (when-let ( section (magit-current-section))
549
+ (when-let* (( section (magit-current-section) ))
550
550
(when (eq (oref section type) 'flake-output )
551
551
(oref section value))))
552
552
@@ -558,7 +558,7 @@ directory. It implies LOCAL."
558
558
(while (setq section (magit-current-section))
559
559
(when (eq (oref section type) 'flake-output-type )
560
560
(throw 'output-type (oref section value)))
561
- (if-let ( parent (oref section parent))
561
+ (if-let* (( parent (oref section parent) ))
562
562
(let ((pos (point )))
563
563
(magit-section-goto parent)
564
564
; ; If there is no heading for the parent branch, the position
@@ -618,7 +618,7 @@ directory. It implies LOCAL."
618
618
619
619
(defun nix3-flake-insert-header (url )
620
620
(insert (propertize " Flake: " 'face 'magit-section-heading ))
621
- (if-let ( metadata (nix3-flake-metadata--get url))
621
+ (if-let* (( metadata (nix3-flake-metadata--get url) ))
622
622
(if (member (nix3-lookup-tree '(original type) metadata)
623
623
'(" indirect" " path" " git" ))
624
624
(insert (cdr (assq 'originalUrl metadata)))
@@ -632,7 +632,7 @@ directory. It implies LOCAL."
632
632
(let (result)
633
633
(cl-labels
634
634
((go (rev-path node)
635
- (if-let ( type (cdr (assq 'type node)))
635
+ (if-let* (( type (cdr (assq 'type node) )))
636
636
(push (cons type rev-path) result)
637
637
(pcase-dolist (`(, name . , child ) node)
638
638
(go (cons name rev-path) child)))))
@@ -645,7 +645,7 @@ directory. It implies LOCAL."
645
645
(seq-sort-by #'car #'string< ))))
646
646
647
647
(defun nix3-flake--direct-inputs ()
648
- (if-let ( result (nix3-flake--get-metadata-result))
648
+ (if-let* (( result (nix3-flake--get-metadata-result) ))
649
649
(let* ((nodes (nix3-lookup-tree '(locks nodes) result))
650
650
(names (mapcar #'car (nix3-lookup-tree '(root inputs) nodes))))
651
651
(mapcar (lambda (name )
@@ -656,7 +656,7 @@ directory. It implies LOCAL."
656
656
657
657
(defun nix3-flake-insert-inputs ()
658
658
(require 'nix3-flake-input )
659
- (when-let ( result (nix3-flake--get-metadata-result))
659
+ (when-let* (( result (nix3-flake--get-metadata-result) ))
660
660
(nix3-section-with-keymap nix3-flake-input-map
661
661
(magit-insert-section (flake-inputs nil (nix3-flake--fold-toplevel-p))
662
662
(magit-insert-heading " Flake inputs" )
@@ -783,7 +783,7 @@ directory. It implies LOCAL."
783
783
(read-only-mode 1 ))
784
784
785
785
(defun nix3-flake-show-eldoc (callback )
786
- (when-let ( help (get-char-property (point ) 'help-echo ))
786
+ (when-let* (( help (get-char-property (point ) 'help-echo ) ))
787
787
(when (stringp help)
788
788
(funcall callback help))))
789
789
@@ -921,7 +921,7 @@ directory. It implies LOCAL."
921
921
" Go to the flake buffer."
922
922
(interactive )
923
923
(when (eq major-mode 'nix3-flake-show-mode )
924
- (when-let ( buffer (pop nix3-flake-show-history))
924
+ (when-let* (( buffer (pop nix3-flake-show-history) ))
925
925
(switch-to-buffer buffer))))
926
926
927
927
; ;;; Bookmark integration
@@ -937,9 +937,9 @@ directory. It implies LOCAL."
937
937
938
938
;;;### autoload
939
939
(defun nix3-flake-show-bookmark-handler (bookmark )
940
- (if-let ( url (bookmark-prop-get bookmark 'url ))
940
+ (if-let* (( url (bookmark-prop-get bookmark 'url ) ))
941
941
(nix3-flake-show-url url)
942
- (if-let ( dir (bookmark-prop-get bookmark 'default-directory ))
942
+ (if-let* (( dir (bookmark-prop-get bookmark 'default-directory ) ))
943
943
(if (file-directory-p dir)
944
944
(nix3-flake-show dir)
945
945
(user-error " Trying to open a bookmark on a non-existent directory: %s" bookmark))
@@ -1005,11 +1005,11 @@ If NO-CONFIRM is non-nil, "
1005
1005
(then `(lambda (_)
1006
1006
(let (message-log-max )
1007
1007
(message nil ))
1008
- (if-let (templates (thread-last
1009
- (nix3-flake-show--get , url )
1010
- ; ; Since Nix 2.7, the default template is templates.default, so we
1011
- ; ; won't consider defaultTemplate.
1012
- (alist-get 'templates )))
1008
+ (if-let* ( (templates (thread-last
1009
+ (nix3-flake-show--get , url )
1010
+ ; ; Since Nix 2.7, the default template is templates.default, so we
1011
+ ; ; won't consider defaultTemplate.
1012
+ (alist-get 'templates ) )))
1013
1013
(concat , name-or-url
1014
1014
" #" (nix3-flake--complete-template , prompt templates))
1015
1015
(error " No template " ))))
@@ -1065,7 +1065,7 @@ If NO-CONFIRM is non-nil, "
1065
1065
templates)))
1066
1066
(cl-labels
1067
1067
((annotator (candidate)
1068
- (if-let ( description (cdr (assoc candidate template-alist)))
1068
+ (if-let* (( description (cdr (assoc candidate template-alist) )))
1069
1069
(concat " " description)
1070
1070
" " ))
1071
1071
(group (candidate transform)
@@ -1098,7 +1098,7 @@ then runs `nix3-flake-init'."
1098
1098
(interactive )
1099
1099
(when nix3-flake-url
1100
1100
(user-error " You must run this command inside a local flake" ))
1101
- (if-let ( dir (locate-dominating-file default-directory " flake.nix" ))
1101
+ (if-let* (( dir (locate-dominating-file default-directory " flake.nix" ) ))
1102
1102
(funcall nix3-flake-edit-find-file-fn (expand-file-name " flake.nix" dir))
1103
1103
(let ((default-directory (or (vc-git-root default-directory)
1104
1104
(progn
@@ -1122,7 +1122,7 @@ then runs `nix3-flake-init'."
1122
1122
1123
1123
(defun nix3-flake-remember-this-project ()
1124
1124
" Remember the current project."
1125
- (when-let ( pr (project-current ))
1125
+ (when-let* (( pr (project-current ) ))
1126
1126
(project-remember-project pr)))
1127
1127
1128
1128
; ;;; Manage relationships between remote repositories and local copies
0 commit comments