Skip to content

Fix compilation warnings #494 #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -475,18 +475,11 @@ ENDP and DELIMITER."
(declare-function paredit-close-curly "ext:paredit")
(declare-function paredit-convolute-sexp "ext:paredit")

(defun clojure--replace-let-bindings-and-indent (orig-fun &rest args)
"Advise ORIG-FUN to replace let bindings.

Sexps are replace by their bound name if a let form was
convoluted.

ORIG-FUN should be `paredit-convolute-sexp'.

ARGS are passed to ORIG-FUN, as with all advice."
(defun clojure--replace-let-bindings-and-indent ()
"Replace let bindings and indent."
(save-excursion
(backward-sexp)
(when (looking-back clojure--let-regexp)
(when (looking-back clojure--let-regexp nil)
(clojure--replace-sexps-with-bindings-and-indent))))

(defun clojure-paredit-setup (&optional keymap)
Expand Down Expand Up @@ -2063,9 +2056,8 @@ many times."
(condition-case nil
(save-match-data
(let ((original-position (point))
clojure-comment-start clojure-comment-end)
clojure-comment-end)
(beginning-of-defun)
(setq clojure-comment-start (point))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clojure-comment-start was generating a warning and as far as I can tell It is unused? It may be that I'm missunderstanding something?

clojure-mode.el:2023:1:Warning: Unused lexical variable
    ‘clojure-comment-start’

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think that's supposed to be a buffer local variable. Let me take a closer look at the code - we might have made some real mistake. :-)

(end-of-defun)
(setq clojure-comment-end (point))
(beginning-of-defun)
Expand Down Expand Up @@ -2120,8 +2112,7 @@ list of (fn args) to pass to `apply''"
Point must be between the opening paren and the ->> symbol."
(forward-sexp)
(save-excursion
(let ((beg (point))
(contents (clojure-delete-and-extract-sexp)))
(let ((contents (clojure-delete-and-extract-sexp)))
(when (looking-at " *\n")
(join-line 'following))
(clojure--ensure-parens-around-function-names)
Expand Down Expand Up @@ -2461,7 +2452,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-if"
(condition-case nil
(backward-up-list)
(scan-error (user-error "`clojure-cycle-not' must be invoked inside a list")))
(if (looking-back "(not ")
(if (looking-back "(not " nil)
(progn
(delete-char -5)
(forward-sexp)
Expand Down Expand Up @@ -2680,7 +2671,7 @@ into the let form."
With a numeric prefix argument slurp the next N s-expressions into the let form."
(interactive "p")
(unless n (setq n 1))
(dotimes (k n)
(dotimes (_ n)
(save-excursion (clojure--let-forward-slurp-sexp-internal))))

;;;###autoload
Expand Down