Skip to content
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

Remove warnings #409

Merged
merged 4 commits into from
Nov 26, 2023
Merged

Remove warnings #409

merged 4 commits into from
Nov 26, 2023

Conversation

matsl
Copy link
Collaborator

@matsl matsl commented Nov 25, 2023

What

Remove warnings

Why

Recent updates have introduced a set of new warnings. This tries to remove the warnings by:

  1. First of all using declare-function for declaring unknown functions.
  2. Fix call to derived-mode-p that only takes one arg, a list, and not multiple args. Reverted. This change is introduced in Emacs 30.1 so will not affect older versions and it is backwards compatible so we can ignore this for now.
  3. Move private vars before their first use.
  4. Remove a warning for a variable not used. (Not in a separate commit. See comment below.)

@@ -1595,11 +1684,10 @@ Return number of matching entries found."
(forward-line)
(setq hdr-pos (cons (point-min) (point))))
(let ((case-fold-search t)
match-start
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

match-start is not used and can thus be removed.

This reverts commit 95f3ba0.

This change is from Emacs 30.1 so lets wait with this. The call is
still backwards compatible and will only give a warning in Emacs 30.1.
@matsl matsl requested a review from rswgnu November 25, 2023 23:46
Copy link
Owner

@rswgnu rswgnu left a comment

Choose a reason for hiding this comment

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

derived-mode-p as of Emacs 28.2 uses &rest to create a single list from all args given, so sending it a list as an arg may break it and is not necessary. Did the calling signature change at some point?

Remove that change and the rest looks good.

@matsl
Copy link
Collaborator Author

matsl commented Nov 26, 2023

Thanks for approving.

derived-mode-p as of Emacs 28.2 uses &rest to create a single list from all args given, so sending it a list as an arg may break it and is not necessary. Did the calling signature change at some point?

It is changed in Emacs 30.1 to only take either one symbol or a list of symbols. So that hit me as a warning since I develop using the latest and greatest!

But the test cases in CI made me aware that this change is not backwards compatible so I ha to revert that part of the PR, see commit 1f4381d. Hence point 2 is over struck although I understand it is not clear that the following comment is an explanation on why we keep the old code with using multiple symbols. The reason is that the change in 30.1 is backwards compatible so calling it with multiple symbols still work. I guess it will be removed at some point in the future. So for now we will have to live with the warning in Emacs 30.1. Maybe later it is time to deal with this.

@matsl matsl merged commit 9d596dc into master Nov 26, 2023
5 checks passed
@matsl matsl deleted the remove-warnings branch November 26, 2023 15:20
@rswgnu
Copy link
Owner

rswgnu commented Nov 26, 2023 via email

@matsl
Copy link
Collaborator Author

matsl commented Nov 26, 2023

Yes, will be interesting to see why they made this change.

In the bug report there is some rational. https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-11/msg00497.html

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