swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
363 stars 47 forks source link

Fix warnings #179

Closed taku0 closed 1 year ago

taku0 commented 1 year ago

Co-authored-by: @monnier

taku0 commented 1 year ago

@monnier

monnier commented 1 year ago

taku0 [2022-09-18 08:17:32] wrote:

  • Why did you delete :group from customizations?

Those were redundant (:group is only needed when the group is different from the last group defined, so for the usual case of a file that defines exactly one group, the :group is not needed unless you want your var to appear in another group).

  • Maybe with-eval-after-load would avoid the duplication? package-lint warns any use of with-eval-after-load, so I didn't use it.

I don't see why with-eval-after-load would be considered worse than what you're currently using.

AFAIK the main problem with (with-)eval-after-work was when you pass it a string (file name) rather than a symbol (feature name). But you'd have to ask the author of package-lint to know why his tool flags that.

    Stefan
taku0 commented 1 year ago

The description in the Elisp manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html The rule of the linter: https://github.com/purcell/package-lint/blob/70529b2ecba5f3a037be8b2c6ecbca769c64b00e/package-lint.el#L632-L638 The author's opinion: https://github.com/purcell/package-lint/issues/125#issuecomment-602902003

Possible options:

So I will keep the current code for now.

taku0 commented 1 year ago

I have deleted redundant :group attributes. Merging now. Thank you.

monnier commented 1 year ago

taku0 [2022-09-18 23:07:26] wrote:

The description in the Elisp manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html The rule of the linter: https://github.com/purcell/package-lint/blob/70529b2ecba5f3a037be8b2c6ecbca769c64b00e/package-lint.el#L632-L638 The author's opinion: https://github.com/purcell/package-lint/issues/125#issuecomment-602902003

I just added a comment to that package-lint issue, thanks.

Possible options:

  • Make swift-mode-speedbar package; it sounds futile.

And won't help.

  • Persuade the author of package-lint; heavy odds.

:-)

So I will keep the current code for now.

Fair enough. If I were you, I'd add a short comment explaining why we're not using with-eval-after-load.

    Stefan
taku0 commented 1 year ago

@monnier The bugs related to autoloads are fixed in 29.1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58015. Thank you.