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 05:42:23 +0200 Message-ID: <87mvzoh2sg.fsf@nl106-137-147.student.uu.se> References: <87bng5qrcp.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435203849 16030 80.91.229.3 (25 Jun 2015 03:44:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 03:44:09 +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 05:44:01 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 1Z7y52-0002vD-Ja for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 05:44:00 +0200 Original-Received: from localhost ([::1]:53807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7y51-0003Xk-MP for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 23:43:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7y4o-0003Xc-SJ for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 23:43:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7y4l-0001XN-MG for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 23:43:46 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7y4l-0001XG-FA for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 23:43:43 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z7y4k-0002dL-9Y for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 05:43:42 +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 05:43:42 +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 05:43:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 53 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:k7z/75WplcLLTXfnNJeHOvq3CLQ= 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:105145 Archived-At: Stefan Monnier writes: > The tendency over the year has been first to move it > all into the compiler (since the kind of analysis > needed to give those warnings is often useful for > a compiler to generate better code as well), and > then to add specialized tools again (that focus on > particular coding errors). IIUC the reason to > develop the newer tools separately from the > compilers is because they tend to use different > analyses (e.g. more superficial (paying attention to > identifier names), or much more costly, or that > require extra information/setup from the coders, > ...). If it were up to me, superficial or super-costly, it would still be placed along with the compiler and invoked with options rather than having that as separate tools. > In any case, within the Elisp realm, we're still at > the stage where the compiler is the most common > place to add warnings. There are a few other tools > (elint and checkdoc), of course. The compiler warnings are great and perhaps more can be added still? For example, remember the discussion `if' and (if (not ...)) vs `when' and `unless'? No? Anyway at that time I thought `if' was better because then you can add an else clause later (if necessary) without having to change the function, and you can start writing the block without thinking how it will end. I understand that thinking but for whatever reason somewhere along the way I just started using when/unless instead and now I think those are much better whenever there isn't an else path (with when/unless, `if' also signals there is one). Perhaps the compiler can warn about that as well? But, if it gets that aggressive and subjective in, eh, "style", then people will get crazy if they can't shut it up if their style conflicts. So I think warnings should be added in the thousands, and then mutable one by one... I'll try elint tomorrow. checkdoc is good, no doubt, as is the help. Not all functions in official Emacs (in Gnus, for example) do as checkdoc says and mention the args in the correct order and all that. It makes sense and is easy, so why not just do it? -- underground experts united http://user.it.uu.se/~embe8573