@@ -1977,28 +1977,28 @@ command will add the corresponding require statement to the ns
1977
1977
form."
1978
1978
(interactive )
1979
1979
(insert " /" )
1980
- (unless ( or ( cljr--in-map-destructuring ?)
1981
- ( cljr--in-ns-above-point-p )
1982
- ( cljr--in-reader-literal -p))
1983
- ( when-let (aliases ( and cljr-magic-requires
1984
- (not (cider-in-comment-p))
1985
- (not (cider-in-string-p))
1986
- (not (cljr--in-keyword-sans-alias-p))
1987
- (clojure-find-ns)
1988
- (cljr--magic-requires-lookup-alias)))
1989
- (let ((short (cl-first aliases)))
1990
- (when-let (long (cljr--prompt-user-for " Require " (cl-second aliases)))
1991
- (when (and (not (cljr--in-namespace-declaration-p (concat " :as " short " \b " )))
1992
- (or (not (eq :prompt cljr-magic-requires))
1993
- (not (> (length (cl-second aliases)) 1 )) ; already prompted
1994
- (yes-or-no-p (format " Add %s :as %s to requires? " long short))))
1995
- (save-excursion
1996
- (cljr--insert-in-ns " :require" )
1997
- (let ((libspec (format " [%s :as %s ] " long short)))
1998
- (insert libspec)
1999
- (ignore-errors (cljr--maybe-eval-ns-form))
2000
- (cljr--indent-defun)
2001
- (cljr--post-command-message " Required %s" libspec) ))))))))
1980
+ (when-let (aliases ( and cljr-magic-requires
1981
+ ( not ( cljr--in-map-destructuring ?) )
1982
+ ( not ( cljr--in-ns-above-point -p))
1983
+ ( not ( cljr--in-reader-literal-p))
1984
+ (not (cider-in-comment-p))
1985
+ (not (cider-in-string-p))
1986
+ (not (cljr--in-keyword-sans-alias-p))
1987
+ (clojure-find-ns)
1988
+ (cljr--magic-requires-lookup-alias)))
1989
+ (let ((short (cl-first aliases)))
1990
+ (when-let (long (cljr--prompt-user-for " Require " (cl-second aliases)))
1991
+ (when (and (not (cljr--in-namespace-declaration-p (concat " :as " short " \b " )))
1992
+ (or (not (eq :prompt cljr-magic-requires))
1993
+ (not (> (length (cl-second aliases)) 1 )) ; already prompted
1994
+ (yes-or-no-p (format " Add %s :as %s to requires? " long short))))
1995
+ (save-excursion
1996
+ (cljr--insert-in-ns " :require" )
1997
+ (let ((libspec (format " [%s :as %s ] " long short)))
1998
+ (insert libspec)
1999
+ (ignore-errors (cljr--maybe-eval-ns-form))
2000
+ (cljr--indent-defun)
2001
+ (cljr--post-command-message " Required %s" libspec))))))))
2002
2002
2003
2003
(defun cljr--in-namespace-declaration-p (s )
2004
2004
(save-excursion
0 commit comments