* fset and error reporting
@ 2014-09-02 17:33 Dmitry Antipov
2014-09-02 18:42 ` Jordon Biondo
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2014-09-02 17:33 UTC (permalink / raw)
To: Emacs development discussions
My .emacs has:
(fset 'yes-or-no-p 'y-or-n-p)
With -Q, I have:
(yes-or-no-p) ==> Wrong number of arguments: yes-or-no-p, 0
After loading .emacs, I have mysterious:
(yes-or-no-p) ==> Wrong number of arguments: (1 . 1), 0
Can someone explain why it is so?
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fset and error reporting
2014-09-02 17:33 fset and error reporting Dmitry Antipov
@ 2014-09-02 18:42 ` Jordon Biondo
0 siblings, 0 replies; 2+ messages in thread
From: Jordon Biondo @ 2014-09-02 18:42 UTC (permalink / raw)
To: Dmitry Antipov; +Cc: Emacs development discussions
It does not have to do with fset. Rather yes-or-no-p is a `subrp` and is being evaluated by eval.c(eval_sub) and y-or-no-p is a `byte-code-function-p` evaluated by bytecode.c(exec_byte_code). These two functions both signal about incorrect number of args if needed, but pass different data in. bytecode.c seems to be the oddball as all such signals pass function name and number of args given but bytecode.c passes a cons with min/max args.
If you’re actually wondering why it was chosen that sometimes the cons cell is passed in and sometimes not, well I have no idea.
Hope it helps!
Jordon
On Sep 2, 2014, at 1:33 PM, Dmitry Antipov <dmantipov@yandex.ru> wrote:
> My .emacs has:
>
> (fset 'yes-or-no-p 'y-or-n-p)
>
> With -Q, I have:
>
> (yes-or-no-p) ==> Wrong number of arguments: yes-or-no-p, 0
>
> After loading .emacs, I have mysterious:
>
> (yes-or-no-p) ==> Wrong number of arguments: (1 . 1), 0
>
> Can someone explain why it is so?
>
> Dmitry
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-02 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 17:33 fset and error reporting Dmitry Antipov
2014-09-02 18:42 ` Jordon Biondo
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.