From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Byte-compiler warnings for todo-mode.el Date: Sun, 05 Aug 2018 22:57:02 +0200 Message-ID: <87zhy0fs69.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1533502540 14163 195.159.176.226 (5 Aug 2018 20:55:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Aug 2018 20:55:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 05 22:55:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fmQ3r-0003ap-Mn for ged-emacs-devel@m.gmane.org; Sun, 05 Aug 2018 22:55:35 +0200 Original-Received: from localhost ([::1]:59824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmQ5x-0001QO-TD for ged-emacs-devel@m.gmane.org; Sun, 05 Aug 2018 16:57:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmQ5M-0001Q4-V4 for emacs-devel@gnu.org; Sun, 05 Aug 2018 16:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmQ5J-00057O-TW for emacs-devel@gnu.org; Sun, 05 Aug 2018 16:57:09 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:47749) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmQ5J-00054G-K1 for emacs-devel@gnu.org; Sun, 05 Aug 2018 16:57:05 -0400 Original-Received: from rosalinde ([178.1.58.195]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lmqxo-1gRH8c3ifM-00h32r for ; Sun, 05 Aug 2018 22:57:03 +0200 X-Provags-ID: V03:K1:Sf1gyHHv/9Zh5fnexEUs2RU4kf5obdMaKUUE4sPxMlx4Z3IonaP tqSfwWQz0DqyXuE7aDfCl11j6nnDcETAxkmkGteaKykWIEx+L/uZxs7R4Zg5FtRG5Z7RGqv upbHM0l+sFzBBArEugzP2lNg62USQUCUncbGnmuNMJTl+zr4UoWO4QH+Tzt6elvUDqwAVfn dq3UD/YQgAOFKr6Gxq4Jg== X-UI-Out-Filterresults: notjunk:1;V01:K0:W8IWESRvv7Y=:SJ3WH+4QyU2zQ0IySUbP9f VmsSSrfTTsQRDNzUsQtoWR/wc0QfVLvWwgsmuizfVctJLq/URvQHiv9PTZFWLbDlz9ebPHQ0W Joij+3UWrvPgIXMh/00CQiJswiXhKcchJ+m+VD8Q0mEOP6DB/nRT4JsPzvKo2CgQMcAWNIj1F vdqEhgx458+YgUUxNB/qhW66gdhY0aHCTi80pfIBtCh3GLzXnqAKiChXgAtgPS/9rGz8Q8sOH MFctlwpwsbfPG5/8NhXUNxEAo8D39L4Q8qemdHpbpRLx7ZHAMOEsYt6B9YNY2L84wVsQck1xR /+sGb4I6k9ol11IQ7uKP5QEaSdl8AcTEVkX6cAxH49hg6fGKhjTkO0a6nUp1iBO0Z+pX/c4JG KR+WBsS1AnzWvElReOyRKEvNS5dnBa745GEe37KUNDvzKSUgo7tnhIVh8p5Fc1tdV5RwLoQXw 5ApZ7805YT4Mg/8dg31/E1+1KMQFszRRcovCc3gENkAvdVoP/R37K8x9A4UWF/YeluE52aFba pFrhRBGlD9XAGsdIyE/YeyAbsqw3tHPj39img7YXUB+vk0hf24c2hUxTj9REpAZolmKExoNOx Rj5GnHTYXzhn+2a9HvrmQFJ45/z1IhponZL2/iiQY0/qzH0PlVQtjgNxkTkyRt3niu2HGGKa5 AY1RhEvCMVjRofnxvCzryVsC0/CyeTptNtefpWAHaravgpBXFRclbZQZ8PQtxTR3mzFq7VzfK YUgXN2OKcn6j9avEWaN1NaoCd0nKBkEp9hfq6EkWC1HHb/BkrpzLEjvGUpuOa/u9o8wv9sZh X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228198 Archived-At: After changes I made in master f7d65a5, byte-compiling todo-mode.el now produces these warnings: todo-mode.el:4048:1:Warning: Unused lexical variable =E2=80=98sfnlist=E2= =80=99 In end of data: todo-mode.el:6785:1:Warning: the function =E2=80=98hl-line-highlight=E2= =80=99 might not be defined at runtime. The first warning is due to code containing the following lines: (let (... falist sfnlist ...) (dolist (f files) ... (push (...) falist)) (setq sfnlist (mapcar #'car falist)) (setq file (completing-read "Choose a filtered items file: " falist nil t nil 'sfnlist (caar falist))) ...) So sfnlist is a list produced on the fly as the HIST argument of completing-read, which is required to be a symbol. I checked a few examples in the emacs sources and all instances of the HIST argument were defvar'd variables. In the above todo-mode.el case, it seems like overkill to add a global variable that has no other use than the above. Given this, is it acceptable to leave the warning or is it preferable to add a defvar to suppress it? The second warning is due to this line: (if (and (boundp 'hl-line-mode) hl-line-mode) (hl-line-highlight)) The warning can be prevented with (eval-and-compile (require 'hl-line)). In fact, I use that elsewhere in todo-mode.el when hl-line-mode is actually enabled, so that when the function the above line of code is part of is executed, either hl-line.el is already loaded and hl-line-highlight is defined, or hl-line-mode is nil, so (hl-line-highlight) won't be evaluated and hence it doesn't matter if it's not defined. Given this, is it acceptable to leave the warning or is it preferable to suppress it? (I already added the above boundp check to suppress the warning "reference to free variable `hl-line-mode'"; would it have been acceptable to leave this warning as well?) Steve Berman