Skip to content

Fix lexical-dynamic warnings#284

Merged
matsl merged 1 commit intomasterfrom
fix_lexical_dynamic_warnings
Oct 16, 2022
Merged

Fix lexical-dynamic warnings#284
matsl merged 1 commit intomasterfrom
fix_lexical_dynamic_warnings

Conversation

@matsl
Copy link
Copy Markdown
Collaborator

@matsl matsl commented Oct 13, 2022

What

Fix lexical-dynamic warnings.

Why

kotl/kview.el:807:54: Warning: Lexical argument shadows the dynamic variable fill-prefix
kotl/kview.el:1399:10: Warning: Variable ‘pos’ left uninitialized
hmouse-sh.el:276:29: Warning: Lexical argument shadows the dynamic variable hmouse-middle-flag
hmouse-sh.el:472:30: Warning: Lexical argument shadows the dynamic variable hmouse-middle-flag
hpath.el:1656:27: Warning: Variable ‘modifier’ left uninitialized

(setq path (hpath:call
(lambda (path non-exist)
(let (modifier
(let ((modifier nil)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@rswgnu modifier is strange. Never set and used in call to two later concat calls. Code might be possible to clean up more so leaving this for you to look into if modifier can be removed and the concat calls simplified?

(while (re-search-forward indent nil t)
(delete-region
(+ (match-beginning 0) 2) (match-end 0)))))))
pos)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

pos does not look like it is used so removing it.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You are right that it is not really used but it is sent in a call about 2 lines down but then the value is ignored in the called function as well. Let's push your updates and then I'll finish the changes here after.

@matsl matsl requested a review from rswgnu October 13, 2022 20:58
(while (re-search-forward indent nil t)
(delete-region
(+ (match-beginning 0) 2) (match-end 0)))))))
pos)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You are right that it is not really used but it is sent in a call about 2 lines down but then the value is ignored in the called function as well. Let's push your updates and then I'll finish the changes here after.

@matsl matsl force-pushed the fix_lexical_dynamic_warnings branch from 972ed4d to daa3031 Compare October 16, 2022 16:36
@matsl matsl merged commit 709fa69 into master Oct 16, 2022
@matsl matsl deleted the fix_lexical_dynamic_warnings branch October 16, 2022 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants