GNU bug report logs - #15862
aliases to macros at compile time

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Mon, 11 Nov 2013 20:04:02 UTC

Severity: minor

Found in versions 27.1, 24.3

Full log


Message #5 received at 15862 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug#15862 <15862 <at> debbugs.gnu.org>
Subject: Re: Status: aliases to macros at compile time
Date: Mon, 07 Oct 2019 17:50:26 +0200
This bug report also comes out blank in the mbox interface, but is
displayed on the web.

[...]

-----

(defvar foo-var 0)

(defmacro foo-mac ()
  '(setq foo-var (1+ foo-var)))

(define-obsolete-function-alias 'old-mac #'foo-mac "24.4")

(defun foo-fails ()
  (old-mac))

(defun foo-works ()
  (foo-mac))


Compile:
foo.el:13:4:Warning: the function `foo-mac' is not known to be defined.

Load compiled version:
(foo-fails) ; -> (invalid-function old-mac)


Also, neither version warns that old-mac is obsolete.

I see now that

(eval-and-compile
  (define-obsolete-function-alias 'old-mac #'foo-mac "24.4"))

works. So maybe that should happen automatically at top-level.


[...]

Fixed the obsolescence warning in 5e6fb1e (auto eval-and-compile make-obsolete.
The invalid function issue remains (still need to manaully eval
top-level aliases to macros at compile-time).

-----

Then I compile it in Emacs 27, I get:

Compiling file /tmp/c.el at Mon Oct  7 17:45:55 2019

In foo-fails:
c.el:9:4:Warning: ‘old-mac’ is an obsolete function (as of 24.4); use
    ‘foo-mac’ instead.

Which seems correct.

If I then

(load "/tmp/c.elc")

I don't get anything about invalid functions.  So has this been fixed,
or am I misinterpreting what the invalid function issue is?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





This bug report was last modified 3 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.