unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15862: Status: aliases to macros at compile time
       [not found] <wrtxfiogeb.fsf@fencepost.gnu.org>
@ 2019-10-07 15:50 ` Lars Ingebrigtsen
  2020-05-04 12:12   ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-07 15:50 UTC (permalink / raw)
  To: bug#15862

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15862: Status: aliases to macros at compile time
  2019-10-07 15:50 ` bug#15862: Status: aliases to macros at compile time Lars Ingebrigtsen
@ 2020-05-04 12:12   ` Stefan Kangas
  2020-05-04 16:14     ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2020-05-04 12:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: bug#15862

Lars Ingebrigtsen <larsi@gnus.org> writes:

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

More information was requested, but none was given within 6 months, so
I'm closing this bug.

If this is still an issue, please reply to this email (use "Reply to
all" in your email client) and we can reopen the bug report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15862: Status: aliases to macros at compile time
  2020-05-04 12:12   ` Stefan Kangas
@ 2020-05-04 16:14     ` Glenn Morris
  2022-01-26 17:19       ` bug#15862: " Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2020-05-04 16:14 UTC (permalink / raw)
  To: 15862; +Cc: larsi, stefan


The invalid function issue remains.

As in the original report:
Compile the file, load the compiled version, *then evaluate: (foo-fails)*.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15862: aliases to macros at compile time
  2020-05-04 16:14     ` Glenn Morris
@ 2022-01-26 17:19       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-26 17:19 UTC (permalink / raw)
  To: Glenn Morris; +Cc: stefan, 15862, monnier

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Glenn Morris <rgm@gnu.org> writes:

> The invalid function issue remains.
>
> As in the original report:
> Compile the file, load the compiled version, *then evaluate: (foo-fails)*.

I can confirm that this issue is still present in Emacs 29.

To reproduce, save the file, byte-compile it and say

M-: (foo-fails)

Debugger entered--Lisp error: (invalid-function old-mac)
  old-mac()
  foo-fails()
  eval-expression((foo-fails) nil nil 127)
  funcall-interactively(eval-expression (foo-fails) nil nil 127)
  command-execute(eval-expression)

Perhaps Stefan M has some comments; added to the CCs.

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

[-- Attachment #2: foo.el --]
[-- Type: application/emacs-lisp, Size: 215 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-26 17:19 UTC | newest]

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

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).