0

I am having a file open with lisp code that has some functions written. The file has elisp-mode as a major mode. Emacs shows highlighting and errors on lines with functions that some function definitions miss or do not have correct comments. I'd like not to see any warnings on the comments. Is it possible to disable those warnings?

Yuki
  • 111
  • 5
  • 1
    The question isn't clear. Show the warning(s) you're talking about - we can't guess what warning you mean, by "function comments" and "something is not according to some rules". (You can wrap code with `with-no-warnings`, to suppress the warnings it produces. But so far you haven't specified what warnings you're talking about.) – Drew Jan 01 '23 at 16:56
  • @Drew Since he mentioned *function* comments, I think he is speaking about byte-compiler warnings. – Tobias Jan 01 '23 at 17:33
  • @Tobias: If you understand what was meant, please edit the question to make what it means clear. Thx. – Drew Jan 01 '23 at 18:31
  • 1
    @Drew Let us see whether he accepts my answer. In that case I or he can edit the question accordingly. Otherwise I just delete my answer and we clarify the question. (BTW, all the best for 2023.) – Tobias Jan 01 '23 at 19:43
  • Pardon, for misunderstanding, I meant warning in a lisp mode inside a buffer. – Yuki Jan 01 '23 at 20:54
  • 1
    That still does not explain what you are doing when you get the warnings. Are you trying to evaluate something or perhaps as @Tobias suggests, are you trying to byte-compile the file? What does the warning say? Does it identify the function? What does that function look like? You need to describe what is happening in detail. – NickD Jan 01 '23 at 21:35
  • I see, sorry. I have updated the post. Does it make more sense now? Thank you. – Yuki Jan 02 '23 at 14:35
  • Sounds like you have `flycheck-mode` enabled. Could you try to switch it off via `M-x` `flycheck-mode` `RET`? Furthermore, my solution of setting `byte-compile-warnings` to nil should also work, since flycheck is using byte compilation in the background AFAIK. – Tobias Jan 02 '23 at 15:13
  • yeah, seems like it is flycheck-mode. Brilliant! Thank you. Do you know if I can disable comment warnings in it? – Yuki Jan 02 '23 at 16:02

1 Answers1

0

If you are talking about the byte compiler warnings you can supress them by setting byte-compiler-warnings to nil file-locally.

E.g., the compiler compiles the following file without warnings.

;; -*- lexical-binding: t; byte-compile-warnings: nil  -*-

(defun foo (bar)
  "Very long function comment that exceeds 80 characters by far through very many characters."
  )

The warnings can be controlled more fine-grained. See the variable documentation of byte-compile-warnings.

Tobias
  • 32,569
  • 1
  • 34
  • 75