[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...)
From: |
Michael Heerdegen |
Subject: |
bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...) |
Date: |
Sun, 10 Feb 2013 18:14:05 +0100 |
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
- bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...),
Michael Heerdegen <=