GNU bug report logs - #14860
Advice causes byte compile warning: function used to take 0+ arguments, now takes 0

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Sat, 13 Jul 2013 23:37:01 UTC

Severity: minor

Tags: confirmed, fixed, patch

Merged with 27630, 28803

Found in version 26.0.50

Fixed in version 26.1

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14860 in the body.
You can then email your comments to 14860 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to mailing_lists <at> petervasil.net, bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sat, 13 Jul 2013 23:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
New bug report received and forwarded. Copy sent to mailing_lists <at> petervasil.net, bug-gnu-emacs <at> gnu.org. (Sat, 13 Jul 2013 23:37:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: bug-gnu-emacs <at> gnu.org
Subject: [Peter Vasil] emacs 24.3.50.1: Byte compile warning Warning: function
 used to take 0+ arguments, now takes 0
Date: Sat, 13 Jul 2013 19:35:32 -0400
[Message part 1 (text/plain, inline)]
[ Making it into a proper bug-report.  ]

[Message part 2 (message/rfc822, inline)]
From: Peter Vasil <mailing_lists <at> petervasil.net>
To: emacs-devel <at> gnu.org
Subject: emacs 24.3.50.1: Byte compile warning Warning: function used to take
	0+ arguments, now takes 0
Date: Sat, 13 Jul 2013 13:02:24 +0200
Hi list,

I have the following function in my init.el file

(defun goto-line-with-feedback ()
  "Show line numbers temporarily, while prompting for the line number input"
  (interactive)
  (let ((line-numbers-off-p (if (boundp 'linum-mode)
                                (not linum-mode)
                              t)))
    (unwind-protect
        (progn
          (when line-numbers-off-p
            (linum-mode 1))
          (call-interactively 'goto-line))
      (when line-numbers-off-p
        (linum-mode -1)))))

When I byte-compile init.el I get the following warning:
function goto-line-with-feedback used to take 0+ arguments, now takes 0

With emacs 24.3 I don't get this warning only with emacs trunk.
I am on revision 113411

Thanks,
Peter

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 00:04:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 14860 <at> debbugs.gnu.org
Subject: Re: [Peter Vasil] emacs 24.3.50.1: Byte compile warning Warning:
 function used to take 0+ arguments, now takes 0
Date: Sat, 13 Jul 2013 20:02:56 -0400
> (defun goto-line-with-feedback ()
>   "Show line numbers temporarily, while prompting for the line number input"
>   (interactive)
>   (let ((line-numbers-off-p (if (boundp 'linum-mode)
>                                 (not linum-mode)
>                               t)))
>     (unwind-protect
>         (progn
>           (when line-numbers-off-p
>             (linum-mode 1))
>           (call-interactively 'goto-line))
>       (when line-numbers-off-p
>         (linum-mode -1)))))

> When I byte-compile init.el I get the following warning:
> function goto-line-with-feedback used to take 0+ arguments, now takes 0

I can't reproduce this here.  What does C-h f goto-line-with-feedback RET
say, after starting an Emacs session?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 01:05:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 14860 <at> debbugs.gnu.org
Subject: Re: bug#14860: [Peter Vasil] emacs 24.3.50.1: Byte compile warning
 Warning: function used to take 0+ arguments, now takes 0
Date: Sun, 14 Jul 2013 03:03:53 +0200
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> > When I byte-compile init.el I get the following warning:
> > function goto-line-with-feedback used to take 0+ arguments, now takes 0

FWIW, I get exactly the same message when using nadvices.  Example: put
this into a file:

--8<---------------cut here---------------start------------->8---
(defun test () (message "test"))

(advice-add 'test :before
            (lambda () (message "before advice")))
--8<---------------cut here---------------end--------------->8---

load it, and byte-compile it:

==>

| In test:
| test.el:1:8:Warning: function test used to take 0+ arguments, now takes 0


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 06:35:03 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 14860 <at> debbugs.gnu.org
Subject: Re: bug#14860: [Peter Vasil] emacs 24.3.50.1: Byte compile warning
 Warning: function used to take 0+ arguments, now takes 0
Date: Sun, 14 Jul 2013 02:34:35 -0400
>> > When I byte-compile init.el I get the following warning:
>> > function goto-line-with-feedback used to take 0+ arguments, now takes 0
> FWIW, I get exactly the same message when using nadvices.  Example: put

That's expected, yes.  But in his case it's on a user-defined function,
so it seems unlikely he put an advice on it.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 17:42:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Peter Vasil <mailing_lists <at> petervasil.net>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#14860: [Peter Vasil] emacs 24.3.50.1: Byte compile warning
 Warning: function used to take 0+ arguments, now takes 0
Date: Sun, 14 Jul 2013 13:41:06 -0400
> Indeed, I have an advice on that function
> (defadvice goto-line-with-feedback
>     (after
>      expand-after-goto-line-with-feedback
>      activate compile)
>     "hideshow-expand affected block when using
> goto-line-with-feedback in a collapsed buffer"
>     (save-excursion
>       (hs-show-block)))

Than it's a known issue.  I do wonder, tho: why on earth do you have an
advice on your hand-written function?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 18:05:01 GMT) Full text and rfc822 format available.

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

From: Peter Vasil <mailing_lists <at> petervasil.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14860 <at> debbugs.gnu.org
Subject: Re: bug#14860: [Peter Vasil] emacs 24.3.50.1: Byte compile warning
 Warning: function used to take 0+ arguments, now takes 0
Date: Sun, 14 Jul 2013 11:09:29 +0200
Indeed, I have an advice on that function

(defadvice goto-line-with-feedback
    (after
     expand-after-goto-line-with-feedback
     activate compile)
    "hideshow-expand affected block when using
goto-line-with-feedback in a collapsed buffer"
    (save-excursion
      (hs-show-block)))

Peter

On Sun, Jul 14, 2013 at 1:35 AM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
> [ Making it into a proper bug-report.  ]
>
>
>
> ---------- Forwarded message ----------
> From: Peter Vasil <mailing_lists <at> petervasil.net>
> To: emacs-devel <at> gnu.org
> Cc:
> Date: Sat, 13 Jul 2013 13:02:24 +0200
> Subject: emacs 24.3.50.1: Byte compile warning Warning: function used to take 0+ arguments, now takes 0
> Hi list,
>
> I have the following function in my init.el file
>
> (defun goto-line-with-feedback ()
>   "Show line numbers temporarily, while prompting for the line number input"
>   (interactive)
>   (let ((line-numbers-off-p (if (boundp 'linum-mode)
>                                 (not linum-mode)
>                               t)))
>     (unwind-protect
>         (progn
>           (when line-numbers-off-p
>             (linum-mode 1))
>           (call-interactively 'goto-line))
>       (when line-numbers-off-p
>         (linum-mode -1)))))
>
> When I byte-compile init.el I get the following warning:
> function goto-line-with-feedback used to take 0+ arguments, now takes 0
>
> With emacs 24.3 I don't get this warning only with emacs trunk.
> I am on revision 113411
>
> Thanks,
> Peter
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sun, 14 Jul 2013 18:29:02 GMT) Full text and rfc822 format available.

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

From: Peter Vasil <mailing_lists <at> petervasil.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#14860: [Peter Vasil] emacs 24.3.50.1: Byte compile warning
 Warning: function used to take 0+ arguments, now takes 0
Date: Sun, 14 Jul 2013 20:28:05 +0200
I had the advice only because I adviced the regular goto-line to call
hs-show-block and when I added the got-line-with-feedback I just
copied the first advice and did not realize that it makes no sense. I
have removed the advice now and I've put the hs-show-block into
got-line-with-feedback function.

Sorry for the noise.

Peter

On Sun, Jul 14, 2013 at 7:41 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> Indeed, I have an advice on that function
>> (defadvice goto-line-with-feedback
>>     (after
>>      expand-after-goto-line-with-feedback
>>      activate compile)
>>     "hideshow-expand affected block when using
>> goto-line-with-feedback in a collapsed buffer"
>>     (save-excursion
>>       (hs-show-block)))
>
> Than it's a known issue.  I do wonder, tho: why on earth do you have an
> advice on your hand-written function?
>
>
>         Stefan




Changed bug title to 'Advice causes byte compile warning: function used to take 0+ arguments, now takes 0' from '[Peter Vasil] emacs 24.3.50.1: Byte compile warning Warning: function used to take 0+ arguments, now takes 0' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 15 Apr 2017 02:16:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 15 Apr 2017 02:16:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14860 27630. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 09 Jul 2017 17:51:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Fri, 14 Jul 2017 15:30:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
bug acknowledged by developer. (Fri, 14 Jul 2017 15:30:02 GMT) Full text and rfc822 format available.

Message #34 received at 14860-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 14860-done <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, npostavs <at> users.sourceforge.net
Subject: Byte-compilation warnings for advised functions
Date: Fri, 14 Jul 2017 11:29:48 -0400
I believe I now fixed the warnings for good in bytecomp.el.


        Stefan




Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Fri, 14 Jul 2017 15:30:03 GMT) Full text and rfc822 format available.

Notification sent to Eli Zaretskii <eliz <at> gnu.org>:
bug acknowledged by developer. (Fri, 14 Jul 2017 15:30:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14860; Package emacs. (Sat, 15 Jul 2017 12:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 14860 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: Byte-compilation warnings for advised functions
Date: Sat, 15 Jul 2017 15:37:07 +0300
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, npostavs <at> users.sourceforge.net
> Date: Fri, 14 Jul 2017 11:29:48 -0400
> 
> I believe I now fixed the warnings for good in bytecomp.el.

Thanks, works here.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Aug 2017 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2017 23:34:02 GMT) Full text and rfc822 format available.

Merged 14860 27630 28803. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2017 23:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Nov 2017 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 213 days ago.

Previous Next


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