unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67835: 30.0.50; Error with undocumented disabled commands
@ 2023-12-15 10:45 kakkokakko
  2023-12-16 13:11 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: kakkokakko @ 2023-12-15 10:45 UTC (permalink / raw)
  To: 67835

1. emacs -Q --eval "(progn (defun foo () (interactive)) (put 'foo 'disabled t))"
2. M-x foo RET

Then, I encountered the error message "Wrong type argument:
char-or-string-p, nil". This behavior is different from that in
previous versions, like 27.1, where I received the following message.

| You have invoked the disabled command foo.
| It is disabled because new users often find it confusing.
| Here’s the first part of its description:
| 
|    << not documented >>
| ...

I also expect similar behavior in 30.0.50.

In 30.0.50, it appears that disabled-command-function in
novice.el triggers this error by executing (insert nil) for
undocumented commands in the following code.

| (insert (condition-case ()
|             (documentation cmd)
|           (error "<< not documented >>")))

Although omitting a docstring is generally considered poor practice,
triggering an error for such commands might not be intentional
behavior. The corresponding code in 27.1 was as follows:

| (... (or (condition-case ()
|               (documentation cmd)
|            (error nil))
|          "<< not documented >>"))

-- 
KH





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

* bug#67835: 30.0.50; Error with undocumented disabled commands
  2023-12-15 10:45 bug#67835: 30.0.50; Error with undocumented disabled commands kakkokakko
@ 2023-12-16 13:11 ` Eli Zaretskii
  2023-12-16 19:37   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-12-16 13:11 UTC (permalink / raw)
  To: kakkokakko, Stefan Kangas; +Cc: 67835

> Date: Fri, 15 Dec 2023 19:45:13 +0900
> From: kakkokakko@gmail.com
> 
> 1. emacs -Q --eval "(progn (defun foo () (interactive)) (put 'foo 'disabled t))"
> 2. M-x foo RET
> 
> Then, I encountered the error message "Wrong type argument:
> char-or-string-p, nil". This behavior is different from that in
> previous versions, like 27.1, where I received the following message.
> 
> | You have invoked the disabled command foo.
> | It is disabled because new users often find it confusing.
> | Here’s the first part of its description:
> | 
> |    << not documented >>
> | ...
> 
> I also expect similar behavior in 30.0.50.
> 
> In 30.0.50, it appears that disabled-command-function in
> novice.el triggers this error by executing (insert nil) for
> undocumented commands in the following code.
> 
> | (insert (condition-case ()
> |             (documentation cmd)
> |           (error "<< not documented >>")))
> 
> Although omitting a docstring is generally considered poor practice,
> triggering an error for such commands might not be intentional
> behavior. The corresponding code in 27.1 was as follows:
> 
> | (... (or (condition-case ()
> |               (documentation cmd)
> |            (error nil))
> |          "<< not documented >>"))

Stefan, could you please look into this?  The above seems to come from
your changes in commit 6ad79059d2f843a1be617c72ae0e9d8a02c9a203.  I'd
like to fix this on the emacs-29 branch soon, if possible.

Thanks.





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

* bug#67835: 30.0.50; Error with undocumented disabled commands
  2023-12-16 13:11 ` Eli Zaretskii
@ 2023-12-16 19:37   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2023-12-16 19:37 UTC (permalink / raw)
  To: Eli Zaretskii, kakkokakko; +Cc: 67835-done

Version: 29.2

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Fri, 15 Dec 2023 19:45:13 +0900
>> From: kakkokakko@gmail.com
>>
>> 1. emacs -Q --eval "(progn (defun foo () (interactive)) (put 'foo 'disabled t))"
>> 2. M-x foo RET
>>
>> Then, I encountered the error message "Wrong type argument:
>> char-or-string-p, nil". This behavior is different from that in
>> previous versions, like 27.1, where I received the following message.
>>
>> | You have invoked the disabled command foo.
>> | It is disabled because new users often find it confusing.
>> | Here’s the first part of its description:
>> |
>> |    << not documented >>
>> | ...
>>
>> I also expect similar behavior in 30.0.50.
>>
>> In 30.0.50, it appears that disabled-command-function in
>> novice.el triggers this error by executing (insert nil) for
>> undocumented commands in the following code.
>>
>> | (insert (condition-case ()
>> |             (documentation cmd)
>> |           (error "<< not documented >>")))
>>
>> Although omitting a docstring is generally considered poor practice,
>> triggering an error for such commands might not be intentional
>> behavior. The corresponding code in 27.1 was as follows:
>>
>> | (... (or (condition-case ()
>> |               (documentation cmd)
>> |            (error nil))
>> |          "<< not documented >>"))

Thanks for the bug report!

This should now be fixed on emacs-29.





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

end of thread, other threads:[~2023-12-16 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15 10:45 bug#67835: 30.0.50; Error with undocumented disabled commands kakkokakko
2023-12-16 13:11 ` Eli Zaretskii
2023-12-16 19:37   ` Stefan Kangas

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