From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...) Date: Sun, 10 Feb 2013 18:14:05 +0100 Message-ID: <87fw14xfaa.fsf@web.de> Reply-To: michael_heerdegen@web.de NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1360516373 3497 80.91.229.3 (10 Feb 2013 17:12:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Feb 2013 17:12:53 +0000 (UTC) To: 13676@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 10 18:13:14 2013 Return-path: Envelope-to: geb-bug-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 1U4aSo-0006VL-2c for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Feb 2013 18:13:14 +0100 Original-Received: from localhost ([::1]:49903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aSU-0001Uf-Gc for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Feb 2013 12:12:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aSP-0001Qt-TO for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4aSN-0006JM-25 for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aSM-0006JI-Um for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U4aSc-0007ew-4c for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Feb 2013 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136051637329425 (code B ref -1); Sun, 10 Feb 2013 17:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Feb 2013 17:12:53 +0000 Original-Received: from localhost ([127.0.0.1]:49251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U4aSS-0007eY-Jw for submit@debbugs.gnu.org; Sun, 10 Feb 2013 12:12:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60587) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U4aSP-0007eO-9Z for submit@debbugs.gnu.org; Sun, 10 Feb 2013 12:12:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4aS8-0006Gt-1O for submit@debbugs.gnu.org; Sun, 10 Feb 2013 12:12:33 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:59377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aS7-0006Gp-UK for submit@debbugs.gnu.org; Sun, 10 Feb 2013 12:12:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aS5-0001Q2-Rh for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4aS4-0006GJ-I5 for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:29 -0500 Original-Received: from mout.web.de ([212.227.15.3]:49292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4aS4-0006G2-8f for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2013 12:12:28 -0500 Original-Received: from drachen.dragon ([92.74.177.220]) by smtp.web.de (mrweb003) with ESMTPA (Nemesis) id 0MLPMI-1U42UC1nU2-000v65 for ; Sun, 10 Feb 2013 18:12:26 +0100 X-Provags-ID: V02:K0:AwQY1LK4Ig9QiwWc1xxgD53v3QX8F6beU0juI8cgKtq l6LeEfFkgsDhgxI4OahckD8q3hCK5lWTDJQJeInh6hG+voEuJW fXqnkrXnS+5ICd6nqq5H3GgdxwL5/fZB7TvkHW1OTSSXuf2t30 3uBwtF+KXUI4ig65sntg+zGO2sPm+FraAIuLi/c3rGVD6cpLZG FLYHwlCTW1FeNMhL+ZPUE4KL5RrBMvA4gpfw7JrxOQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71011 Archived-At: Hi, after reading (long ago) in (elisp) Anonymous Functions: ,---------------------------------------------------------------------- | -- Special Form: function function-object | | [...] But unlike `quote', it also serves as a note to the Emacs |evaluator and byte-compiler that FUNCTION-OBJECT is intended to be used |as a function. [...] `---------------------------------------------------------------------- I often used something like this: --8<---------------cut here---------------start------------->8--- ;; my package --- doing cool stuff (defalias #'my-package-end-of-line (if (fboundp #'end-of-visual-line) #'end-of-visual-line #'end-of-line)) (defun my-package-do-cool-stuff () "Doc..." (ding) (goto-char (point-min)) (my-package-end-of-line)) --8<---------------cut here---------------end--------------->8--- If I compile this, I get a warning: ,---------------------------------------------------------------------- | Compiling file /home/micha/today/my-package.el at Sun Feb 10 17:54:08 2013 | | In end of data: | my-package.el:13:1:Warning: the function `my-package-end-of-line' is not known | to be defined. `---------------------------------------------------------------------- If the first arg of `defalias' is quoted with just quote (instead of `#''), however, you don't get a warning. Dunno if it's no good style to use `#'' at that place - OTOH, it works, and the warning is not useful. A fix would presumably need to change the first condition of the `pcase' in `byte-compile-file-form-defalias', probably to something like `(,_ ,(or `',name `(function ,name)) ,arg . ,rest) Thanks, Michael. In GNU Emacs 24.2.93.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2013-02-09 on drachen Bzr revision: cyd@gnu.org-20130209044342-t2b063zu2fqy8nud Windowing system distributor `The X.Org Foundation', version 11.0.10707000 System Description: Debian GNU/Linux 7.0 (wheezy) Configured using: `configure '--prefix=/usr/local/built/'' Important settings: value of $LC_ALL: de_DE.utf8 value of $LC_TIME: C value of $LANG: de_DE.utf8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t