GNU bug report logs - #40653
28.0.50; (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch

Previous Next

Package: emacs;

Reported by: Andrey Orst <andreyorst <at> gmail.com>

Date: Thu, 16 Apr 2020 08:00:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

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 40653 in the body.
You can then email your comments to 40653 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 bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 08:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrey Orst <andreyorst <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Apr 2020 08:00:03 GMT) Full text and rfc822 format available.

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

From: Andrey Orst <andreyorst <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50;
 (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch
Date: Thu, 16 Apr 2020 10:59:12 +0300
[Message part 1 (text/plain, inline)]
Call `emacs -q` do `M-x ansi-term RET` try to kill buffer - a prompt
with `yes` or `no` will be provided. Cancel and call `M-: (fset
'yes-or-no-p 'y-or-n-p) RET`, and try to kill ansi-term buffer
again. Prompt will still ask to input `yes` or `no` instead of `y` or
`n`. Works in master branch of Emacs run with `-q`.

-- 
Best regards,
Andrey Orst
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 08:19:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrey Orst <andreyorst <at> gmail.com>
Cc: 40653 <at> debbugs.gnu.org
Subject: Re: bug#40653: 28.0.50;
 (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch
Date: Thu, 16 Apr 2020 11:18:10 +0300
> From: Andrey Orst <andreyorst <at> gmail.com>
> Date: Thu, 16 Apr 2020 10:59:12 +0300
> 
> Call `emacs -q` do `M-x ansi-term RET` try to kill buffer - a prompt
> with `yes` or `no` will be provided. Cancel and call `M-: (fset
> 'yes-or-no-p 'y-or-n-p) RET`, and try to kill ansi-term buffer
> again. Prompt will still ask to input `yes` or `no` instead of `y` or
> `n`. Works in master branch of Emacs run with `-q`.

I'm not sure I understand the issue.  The last sentence seems to say
this works as expected on the master branch?  That is, the prompt does
ask to input 'y' or 'n', right?  Because that's what I see with
today's master.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 08:22:01 GMT) Full text and rfc822 format available.

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

From: Andrey Orst <andreyorst <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40653 <at> debbugs.gnu.org
Subject: Re: bug#40653: 28.0.50; (fset 'yes-or-no-p 'y-or-n-p) has no effect
 in native-comp branch
Date: Thu, 16 Apr 2020 11:21:19 +0300
[Message part 1 (text/plain, inline)]
On master branch the `fset` command does what expected - prompts that ask
for `yes` or `no` changed to ask `y` or `n`. On native-comp branch however
it has no effect and all prompts still ask for `yes` or `no` after `fset`
call.

On Thu, Apr 16, 2020 at 11:18 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Andrey Orst <andreyorst <at> gmail.com>
> > Date: Thu, 16 Apr 2020 10:59:12 +0300
> >
> > Call `emacs -q` do `M-x ansi-term RET` try to kill buffer - a prompt
> > with `yes` or `no` will be provided. Cancel and call `M-: (fset
> > 'yes-or-no-p 'y-or-n-p) RET`, and try to kill ansi-term buffer
> > again. Prompt will still ask to input `yes` or `no` instead of `y` or
> > `n`. Works in master branch of Emacs run with `-q`.
>
> I'm not sure I understand the issue.  The last sentence seems to say
> this works as expected on the master branch?  That is, the prompt does
> ask to input 'y' or 'n', right?  Because that's what I see with
> today's master.
>


-- 
Best regards,
Andrey Orst
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 08:53:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrey Orst <andreyorst <at> gmail.com>
Cc: 40653 <at> debbugs.gnu.org
Subject: Re: bug#40653: 28.0.50; (fset 'yes-or-no-p 'y-or-n-p) has no effect
 in native-comp branch
Date: Thu, 16 Apr 2020 11:51:58 +0300
> From: Andrey Orst <andreyorst <at> gmail.com>
> Date: Thu, 16 Apr 2020 11:21:19 +0300
> Cc: 40653 <at> debbugs.gnu.org
> 
> On master branch the `fset` command does what expected - prompts that ask for `yes` or `no` changed to
> ask `y` or `n`. On native-comp branch however it has no effect and all prompts still ask for `yes` or `no` after
> `fset` call.

Thanks for clarifying.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 09:02:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrey Orst <andreyorst <at> gmail.com>
Cc: 40653 <at> debbugs.gnu.org, luknax <at> sdf.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#40653: 28.0.50;
 (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch
Date: Thu, 16 Apr 2020 09:01:05 +0000
Andrey Orst <andreyorst <at> gmail.com> writes:

> Call `emacs -q` do `M-x ansi-term RET` try to kill buffer - a prompt
> with `yes` or `no` will be provided. Cancel and call `M-: (fset
> 'yes-or-no-p 'y-or-n-p) RET`, and try to kill ansi-term buffer
> again. Prompt will still ask to input `yes` or `no` instead of `y` or
> `n`. Works in master branch of Emacs run with `-q`.

Hi Andrey,

The issue is that here we are shadowing with an alias a primitive C
subr.

Compiling speed 2 the assumption is that these are not redefined or
advised (the manual warns about doing that).  Function calls to C
primitives at speed 2 are hardcoded for performance reasons in the
generated code.

We have a customize listing exceptions for that
`comp-never-optimize-functions'.

You should solve the issue adding `yes-or-no-p' to this customize and
recompiling.

Now what I'm not sure of is if we want to add `yes-or-no-p' by default
there given that `yes-or-no-p' is never perf critical.  The only issue I
see is that could be the first exception of many.

On the other hand customizing `comp-never-optimize-functions' will solve
the issue only for external packages because you likely already have
compiled the whole Emacs with the default setting...

So yeah I think we should probably add `yes-or-no-p' to
`comp-never-optimize-functions' and accept that we will probably end-up
with few other ecceptions :/

Opinions on this are welcome.

Andrea

-- 
akrl <at> sdf.org




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 09:59:02 GMT) Full text and rfc822 format available.

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

From: Andrey Orst <andreyorst <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 40653 <at> debbugs.gnu.org, luknax <at> sdf.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#40653: 28.0.50; (fset 'yes-or-no-p 'y-or-n-p) has no effect
 in native-comp branch
Date: Thu, 16 Apr 2020 12:58:23 +0300
[Message part 1 (text/plain, inline)]
>
> The issue is that here we are shadowing with an alias a primitive C
> subr.
>
> Compiling speed 2 the assumption is that these are not redefined or
> advised (the manual warns about doing that).  Function calls to C
> primitives at speed 2 are hardcoded for performance reasons in the
> generated code.



 We have a customize listing exceptions for that
> `comp-never-optimize-functions'.
>


You should solve the issue adding `yes-or-no-p' to this customize and
> recompiling.
>

 Ah I see now. This makes sense, although also makes it harder to
configure.

On the other hand customizing `comp-never-optimize-functions' will solve
>
the issue only for external packages because you likely already have
> compiled the whole Emacs with the default setting...
>

IIUC I may need to modify the source code of the `comp.el` file, because it
gets used when doing `make`?

-- 
Best regards,
Andrey Orst
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 16:50:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrey Orst <andreyorst <at> gmail.com>
Cc: 40653 <at> debbugs.gnu.org, luknax <at> sdf.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#40653: 28.0.50;
 (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch
Date: Thu, 16 Apr 2020 16:49:10 +0000
> IIUC I may need to modify the source code of the `comp.el` file,
> because it gets used when doing `make`? 

Other options would have been to use something like
BYTE_COMPILE_EXTRA_FLAGS to modify its value during compilation but it
is really not practical.

886ded1b70 works for me, closing.

Thanks for reporting!

  Andrea

--
akrl <at> sdf.org




bug closed, send any further explanations to 40653 <at> debbugs.gnu.org and Andrey Orst <andreyorst <at> gmail.com> Request was from Andrea Corallo <akrl <at> sdf.org> to control <at> debbugs.gnu.org. (Thu, 16 Apr 2020 16:59:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Thu, 16 Apr 2020 22:51:01 GMT) Full text and rfc822 format available.

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

From: Sebastian Sturm <mail <at> sebastian-sturm.de>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#40653: 28.0.50; (fset 'yes-or-no-p 'y-or-n-p) has no effect in
 native-comp branch
Date: Fri, 17 Apr 2020 00:14:47 +0200
sorry for being a moron, I had used `counsel-describe-function` instead 
of plain `describe-function` (which indeed shows the function as 
natively compiled). I thought I had used `counsel-describe-function` 
before, but I'm probably mistaken. In any case, apologies for the noise 
and many thanks for your outstanding work on gccemacs!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40653; Package emacs. (Fri, 17 Apr 2020 11:27:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Sebastian Sturm <mail <at> sebastian-sturm.de>
Cc: 40653 <at> debbugs.gnu.org
Subject: Re: bug#40653: 28.0.50;
 (fset 'yes-or-no-p 'y-or-n-p) has no effect in native-comp branch
Date: Fri, 17 Apr 2020 11:26:19 +0000
Sebastian Sturm <mail <at> sebastian-sturm.de> writes:

> sorry for being a moron, I had used `counsel-describe-function`
> instead of plain `describe-function` (which indeed shows the function
> as natively compiled). I thought I had used
> `counsel-describe-function` before, but I'm probably mistaken.

No issue, thanks for reporting.

Andrea

-- 
akrl <at> sdf.org




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

This bug report was last modified 5 years and 37 days ago.

Previous Next


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