unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: bug#15862 <15862@debbugs.gnu.org>
Subject: bug#15862: Status: aliases to macros at compile time
Date: Mon, 07 Oct 2019 17:50:26 +0200	[thread overview]
Message-ID: <871rvo5zct.fsf@gnus.org> (raw)
In-Reply-To: bug's message of "Mon\, 07 Oct 2019 15\:47\:40 +0000"

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






       reply	other threads:[~2019-10-07 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <wrtxfiogeb.fsf@fencepost.gnu.org>
2019-10-07 15:50 ` Lars Ingebrigtsen [this message]
2020-05-04 12:12   ` bug#15862: Status: aliases to macros at compile time Stefan Kangas
2020-05-04 16:14     ` Glenn Morris
2022-01-26 17:19       ` bug#15862: " Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rvo5zct.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=15862@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).