如何修复此 emacs 警告:Warning (bytecomp): 'mapcar' called for effect;使用“mapc”或“dolist”代替

How to fix this emacs warning: Warning (bytecomp): ‘mapcar’ called for effect; use ‘mapc’ or ‘dolist’ instead

在 Windows 7 上安装了最新的 emacs,复制了上次安装的包文件夹,更新了包。收到警告(见下文)。谷歌搜索警告显示了 2007 年的一些简短讨论,但对于非 lispers 来说没有任何简化。有谁知道这个警告指的是什么以及修复是什么?

Warning (bytecomp): ‘mapcar’ called for effect; use ‘mapc’ or ‘dolist’ instead

从 Emacs 堆栈交换中查看 this answer。如果你阅读它,你会发现你有几个选项来解决这个问题:

  1. 将以下注释添加到导致警告的文件底部:

    ;; Local Variables:
    ;; byte-compile-warnings: (not mapcar)
    ;; End:
    
  2. 通过 M-x customize-variable RET byte-compile-warnings RET 设置 byte-compile-warnings 变量。单击 Value Menu 按钮,然后按 1 select Some,然后选中标记为 mapcar 的框。最后点击Apply and Save.

执行这两件事中的其中一项后,警告应该停止出现。