seagle0128 / doom-modeline

A fancy and fast mode-line inspired by minimalism design.
https://seagle0128.github.io/doom-modeline/
GNU General Public License v3.0
1.29k stars 159 forks source link

[Bug] Compiler warning about undefined function `doom-modeline-shorten-irc' #733

Closed dr-scsi closed 2 months ago

dr-scsi commented 2 months ago

Thank you for the bug report

Bug description

During the byte and native compilation, the compiler says:

In end of data:
doom-modeline-core.el:647:40: Warning: the function
    ‘doom-modeline-shorten-irc’ is not known to be defined.

Steps to reproduce

Byte compile the file in a clean environment.

Expected behavior

No compiler warning, maybe just by `declare'-ing the function.

OS

MacOS

Emacs Version

30 (gccemacs)

Emacs Configurations

Vanilla Emacs

Error callstack

No response

Anything else

Note that I'm running Emacs from the master branch, so it is technically Emacs 31 (gccemacs). This is with doom-modeline-20240810.1702 from MELPA.

dr-scsi commented 2 months ago

@seagle0128 - Thanks for the fix. Just a minor note about the patch:

(declare-function doom-modeline-shorten-irc "ext:doom-modeline-segments")

ext: usually marks a file from an external package where no error is issued if the file isn't found. In this case, I think

(declare-function doom-modeline-shorten-irc "doom-modeline-segments")

would be more appropriate, but it is a cosmetic remark, I think.

seagle0128 commented 2 months ago

@dr-scsi Thanks for your comments. Actually I've already fixed it in the next commit 790e6817814a1fa893a91722861cba9424b0f004.