From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Byte-compiler warnings Date: Wed, 24 Jun 2015 23:06:40 -0400 Organization: A noiseless patient Spider Message-ID: References: <874mlxh2tk.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435201819 21090 80.91.229.3 (25 Jun 2015 03:10:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 03:10:19 +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:10:19 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 1Z7xYQ-00051R-CW for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 05:10:18 +0200 Original-Received: from localhost ([::1]:53705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7xYP-0007qO-Lv for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 23:10:17 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Injection-Info: mx02.eternal-september.org; posting-host="dcedd9c6966f9f4f1f31ce18e50f42c3"; logging-data="21650"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Snc2TvVLFY9xtfhvHWQDU" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:fdK/FhM1R59I+1SfP9diaIC1gxg= sha1:OyIL0aKFSLveiX1/WjhllfqmI4A= Original-Xref: usenet.stanford.edu gnu.emacs.help:212856 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:105141 Archived-At: > One question is: if (goto-char (point-min)) is > equivalent, why cannot the byte-compiler just use that > instead for the compiled version? In general such "use instead" messages are used instead of doing the rewrite silently for two reasons: 1- the two aren't actually equivalent. The provide the same feature but in different ways or with different corner case behavior, so the compiler can't safely replace one for the other. E.g. beginning-of-buffer sets the mark; which is the reason why it's usually not what you want from Elisp, but the compiler can't know if that's actually what you want. 2- the two are equivalent, but one is deprecated so we want people to fix the source code. This might be also because the compiler can detect and optimize some cases but not all, so it's important to tell the programmer that these forms are deprecated so she can hopefully stop using them also in those places that the byte-compiler can't detect (e.g. '(lambda ...) vs #'(lambda ...) which then compiler can detect when passed to `apply' or `mapcar' but not in general since in general '(lambda ...) might just be a list rather than a function). Stefan