From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Byte-compiler warnings Date: Thu, 25 Jun 2015 01:50:17 +0200 Message-ID: <87h9pwis3q.fsf@nl106-137-147.student.uu.se> References: <874mlxh2tk.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435189923 12685 80.91.229.3 (24 Jun 2015 23:52:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 23:52:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 25 01:51:54 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z7uSP-0001U9-BM for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 01:51:53 +0200 Original-Received: from localhost ([::1]:53364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7uSO-00011q-J7 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 19:51:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7uSD-00011j-ML for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 19:51:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7uS8-0005e3-Mp for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 19:51:41 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7uS8-0005dl-GG for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 19:51:36 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z7uS7-0001GO-FJ for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 01:51:35 +0200 Original-Received: from nl106-137-246.student.uu.se ([130.243.137.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2015 01:51:35 +0200 Original-Received: from embe8573 by nl106-137-246.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2015 01:51:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 51 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-246.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:w7s+12heaGj3/U4BRb+XgToVlwk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105132 Archived-At: Marcin Borkowski writes: > I remember someone somewhere writing that Emacs > byte-compiler is useful even if you don't want the > compiled code, since it issues various warnings > about bad Elisp constructs. Whoever said that must have been pretty cool :)) But yes. There are many such cases. The help should have the exact same message, is the way I would do it. But its not a big issue if it is there in some other phrasing. E.g., (defun compile-me () (beginning-of-buffer) ) The help says: Don't use this command in Lisp programs! (goto-char (point-min)) is faster. The byte-compiler says: ~/.emacs:6:8:Warning: `beginning-of-buffer' is for interactive use only; use `(goto-char (point-min))' instead. One question is: if (goto-char (point-min)) is equivalent, why cannot the byte-compiler just use that instead for the compiled version? (Granted, there might be more complicated examples that `beginning-of-buffer' vs. (goto-char (point-min))...) > Are there other tools that assist in writing good > Elisp code? I know about checkdoc, is there > anything else? When you have your program you can set up automatic testing to test all possible arg values, and such things. It won't have anything to do with good Lisp but it will find the bugs. Which is much more important. But I agree a set of such tools would be cool insofar as what is needed cannot be incorporated into either of the components already mentioned... -- underground experts united http://user.it.uu.se/~embe8573