unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74364: Bug?
@ 2024-11-15  4:53 Tatsu Takamaro
  2024-11-15  7:18 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Tatsu Takamaro @ 2024-11-15  4:53 UTC (permalink / raw)
  To: 74364

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

Hello! I'm new user. Just read the Manual. And I'd like to report a bug 
or ask a question (if it's not a bug). So, as it said in the Manual, the 
TUTORIAL file that I read is just a copy of the original, so I can 
change it freely. But. When I change it, and then triing to leave Emacs 
(Ctrl + x + c), I got this message.

Error on exit:
tutorial--saved-file: Wrong type argument: stringp, nil

The debugger says:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   file-name-extension(nil)
   tutorial--saved-file()
   tutorial--save-on-kill()
   run-hook-with-args-until-failure(tutorial--save-on-kill)
   save-buffers-kill-emacs(nil)
   save-buffers-kill-terminal(nil)
   funcall-interactively(save-buffers-kill-terminal nil)
   command-execute(save-buffers-kill-terminal)

The error appears only when you try to exit and the TUTORIAL file is 
modified. At the same time, Emacs allows saving the TUTORIAL file by 
Ctrl + x + s during operation.

Regards, Tony.

[-- Attachment #2: Type: text/html, Size: 1383 bytes --]

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

* bug#74364: Bug?
  2024-11-15  4:53 bug#74364: Bug? Tatsu Takamaro
@ 2024-11-15  7:18 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]   ` <3ffa9049-44a1-8a88-69aa-6a7b1d5dabee@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-15  7:18 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

> Hello! I'm new user. Just read the Manual. And I'd like to report a
> bug or ask a question (if it's not a bug). So, as it said in the
> Manual, the TUTORIAL file that I read is just a copy of the original,
> so I can change it freely. But. When I change it, and then triing to
> leave Emacs (Ctrl + x + c), I got this message.
>
> Error on exit:
> tutorial--saved-file: Wrong type argument: stringp, nil

Hi,

It seems like a bug but I cannot reproduce it.  Could you try the same
starting from emacs -Q?
-- 
Manuel Giraud





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

* bug#74364: Bug?
       [not found]   ` <3ffa9049-44a1-8a88-69aa-6a7b1d5dabee@gmail.com>
@ 2024-11-18  9:10     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-19  8:50       ` Tatsu Takamaro
  0 siblings, 1 reply; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-18  9:10 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

> Yes, with a -q key Emacs starts in a default view, and I still get the
> same error, and all other behaviour is the same.

[ Could you please keep the bug tracker as recipient of your message by
doing a "reply to all" ]

From the TUTORIAL buffer, what the key sequence "C-h v tutorial--lang
<RET>" gives you?
-- 
Manuel Giraud





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

* bug#74364: Bug?
  2024-11-18  9:10     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-19  8:50       ` Tatsu Takamaro
  2024-11-19 14:23         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Tatsu Takamaro @ 2024-11-19  8:50 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: 74364

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

tutorial--lang is a variable defined in ‘tutorial.el’.

Its value is "English"
Local in buffer TUTORIAL; global value is nil

Tutorial language.

   Automatically becomes buffer-local when set.

пн, 18.11.2024 12:10, Manuel Giraud пишет:
> Tatsu Takamaro<tatsu.takamaro@gmail.com>  writes:
>
>> Yes, with a -q key Emacs starts in a default view, and I still get the
>> same error, and all other behaviour is the same.
> [ Could you please keep the bug tracker as recipient of your message by
> doing a "reply to all" ]
>
> >From the TUTORIAL buffer, what the key sequence "C-h v tutorial--lang
> <RET>" gives you?

[-- Attachment #2: Type: text/html, Size: 1340 bytes --]

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

* bug#74364: Bug?
  2024-11-19  8:50       ` Tatsu Takamaro
@ 2024-11-19 14:23         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-23  6:44           ` Tatsu Takamaro
  0 siblings, 1 reply; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-19 14:23 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

> tutorial--lang is a variable defined in ‘tutorial.el’.
>
> Its value is "English"
> Local in buffer TUTORIAL; global value is nil
>
> Tutorial language.
>
>   Automatically becomes buffer-local when set.

Thanks, this seems normal.  Which version of emacs are you running?
What gives "M-: (emacs-build-description)"?
-- 
Manuel Giraud





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

* bug#74364: Bug?
  2024-11-19 14:23         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-23  6:44           ` Tatsu Takamaro
  2024-11-23 10:50             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Tatsu Takamaro @ 2024-11-23  6:44 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: 74364

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

In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 built on
  AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.5131)

Configured using:
  'configure --with-modules --without-dbus
  --with-native-compilation=aot --without-compress-install
  --with-sqlite3 --with-tree-sitter CFLAGS=-O2'

вт, 19.11.2024 17:23, Manuel Giraud пишет:
> Tatsu Takamaro<tatsu.takamaro@gmail.com>  writes:
>
>> tutorial--lang is a variable defined in ‘tutorial.el’.
>>
>> Its value is "English"
>> Local in buffer TUTORIAL; global value is nil
>>
>> Tutorial language.
>>
>>    Automatically becomes buffer-local when set.
> Thanks, this seems normal.  Which version of emacs are you running?
> What gives "M-: (emacs-build-description)"?

[-- Attachment #2: Type: text/html, Size: 1555 bytes --]

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

* bug#74364: Bug?
  2024-11-23  6:44           ` Tatsu Takamaro
@ 2024-11-23 10:50             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-25  8:21               ` Tatsu Takamaro
  0 siblings, 1 reply; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-23 10:50 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

> In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 built on
>  AVALON
> Windowing system distributor 'Microsoft Corp.', version 10.0.19045
> System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.5131)

I just tried to reproduce it with Emacs 29.4 (not on windows though) and
I was not able to get the same error as you.

What is strange is that there is only one call to `file-name-extension'
in `tutorial--saved-file' and at this point, as you've seen,
`tutorial--lang' is set to something meaningful (not nil).
-- 
Manuel Giraud





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

* bug#74364: Bug?
  2024-11-23 10:50             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-25  8:21               ` Tatsu Takamaro
  2024-11-25 19:10                 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Tatsu Takamaro @ 2024-11-25  8:21 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: 74364

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

Well, it's not a big problem though. But I can describe my actions as an 
algorithm for you to make it easier to reproduce the bug:

1. I start Emacs, it starts with my minor custom changes that I added to 
.emacs file.

2. Open an Emacs Tutorial with a mouse click and answer Yes to load my 
remembered position.

3. Put some changes into the Tutorial. Say, just add a new line.

4. Press C-x-s to save. Emacs asks me to write a filename, I write 
TUTORIAL, because the full path is alredy shown. Then Emacs asks me 
whether I want to overwrite the file. I anser Yes (type y).

5. Minibuffer shows me message "Wrote c:\...path...TUTORIAL"

6. I Press C-x-c to exit. It shows "Save your position in the 
tutorial?". Answer Yes (y).

7. Minibuffer shows "Wrong type argument: stringp, nil". And doesn't quit!

8. Then I press C-x-c again, but now I choose No (n). And Emacs exits. 
Tutorial file is not saved (I can see it by opening it again and check)!

So, here is how it is going on. But note, that if I skip the 4-th item 
(don't press C-x-s to save) and press C-x-c right after changing the 
Tutorial (addding a new line), Emacs quits normally and the Tutorial 
file is being saved! So, I guess it is a C-x-s function that triggers 
problem.

Hope it will help you cathing the bug.

сб, 23.11.2024 13:50, Manuel Giraud пишет:
> Tatsu Takamaro<tatsu.takamaro@gmail.com>  writes:
>
>> In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 built on
>>   AVALON
>> Windowing system distributor 'Microsoft Corp.', version 10.0.19045
>> System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.5131)
> I just tried to reproduce it with Emacs 29.4 (not on windows though) and
> I was not able to get the same error as you.
>
> What is strange is that there is only one call to `file-name-extension'
> in `tutorial--saved-file' and at this point, as you've seen,
> `tutorial--lang' is set to something meaningful (not nil).

[-- Attachment #2: Type: text/html, Size: 3274 bytes --]

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

* bug#74364: Bug?
  2024-11-25  8:21               ` Tatsu Takamaro
@ 2024-11-25 19:10                 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-26 12:51                   ` Eli Zaretskii
       [not found]                   ` <ab77c50d-6db1-b143-78cf-191c19585280@gmail.com>
  0 siblings, 2 replies; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-25 19:10 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

[...]

Ok, now your recipe is more precise and I can reproduce it.

> 3. Put some changes into the Tutorial. Say, just add a new line.
>
> 4. Press C-x-s to save. Emacs asks me to write a filename, I write
> TUTORIAL, because the full path is alredy shown. Then Emacs asks me
> whether I want to overwrite the file. I anser Yes (type y).

After this 'C-x C-s', you have saved the content of the (modified)
TUTORIAL into a file named "TUTORIAL" somewhere on your hard drive.
Now, in this buffer, `tutorial--lang' is set to nil (which cause the
error you saw) and Emacs still wants to save your progression in the
tutorial and that's why it asks the question when you tried to quit.

This is indeed a bug but maybe saving the TUTORIAL buffer is not
supported.  Or we should remap `save-buffer' to save tutorial
progression here?
-- 
Manuel Giraud





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

* bug#74364: Bug?
  2024-11-25 19:10                 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-26 12:51                   ` Eli Zaretskii
  2024-11-26 18:43                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]                   ` <ab77c50d-6db1-b143-78cf-191c19585280@gmail.com>
  1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2024-11-26 12:51 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: 74364, tatsu.takamaro

> Cc: 74364@debbugs.gnu.org
> Date: Mon, 25 Nov 2024 20:10:49 +0100
> From:  Manuel Giraud via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:
> 
> [...]
> 
> Ok, now your recipe is more precise and I can reproduce it.
> 
> > 3. Put some changes into the Tutorial. Say, just add a new line.
> >
> > 4. Press C-x-s to save. Emacs asks me to write a filename, I write
> > TUTORIAL, because the full path is alredy shown. Then Emacs asks me
> > whether I want to overwrite the file. I anser Yes (type y).
> 
> After this 'C-x C-s', you have saved the content of the (modified)
> TUTORIAL into a file named "TUTORIAL" somewhere on your hard drive.
> Now, in this buffer, `tutorial--lang' is set to nil (which cause the
> error you saw) and Emacs still wants to save your progression in the
> tutorial and that's why it asks the question when you tried to quit.
> 
> This is indeed a bug but maybe saving the TUTORIAL buffer is not
> supported.  Or we should remap `save-buffer' to save tutorial
> progression here?

Saving TUTORIAL is a strange thing to do.  What is the purpose?  The
file produced that way cannot be used as a tutorial, AFAIU, because
Emacs doesn't let users specify the tutorial's file name.

Users are supposed to save tutorial by killing the buffer or exiting
Emacs, in which case Emacs saves the tutorial state as it should be.

So my suggestion would be to modify tutorial--save-tutorial and
tutorial--save-on-kill such that of tutorial--lang is nil, they will
do nothing.  Because there's no point of trying to save the tutorial
in that case.





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

* bug#74364: Bug?
       [not found]                   ` <ab77c50d-6db1-b143-78cf-191c19585280@gmail.com>
@ 2024-11-26 13:11                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-26 13:11 UTC (permalink / raw)
  To: Tatsu Takamaro; +Cc: 74364

Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:

>> This is indeed a bug but maybe saving the TUTORIAL buffer is not
>> supported.  Or we should remap `save-buffer' to save tutorial
>> progression here?

Please keep the bug tracker mail address in your replies.  As a rule of
thumb, you should always use « Reply to all » when interacting here.

> Well, for I'm new to Emacs, I can't say what is better. I'm glad you
> found the issue. Now it's up to you to decide what to do with it. I
> can just mention that in the Tutorial text there is a "task" for a
> reader to do C-x-s. An attentive and thorough learner, who does all
> the "homework", would do that C-x-s and in some time he would want to
> exit Emacs. Thus he would apparently face the bug. As I did.

Thanks.  I think I'll have to look into the tutorial to see how what is
instructed there lead to this behaviour.  Maybe it will give us a hint
of what should be done.

> Thank you for help and kindness! Emacs is great. The more I learn it
> the more I see it.
>
> P.S. Remapping keys is a too difficult topic to learn though, there
> are questions. I'll ask them a bit later.

Of course but I thought more about a remapping that should be done by
default in the tutorial.
-- 
Manuel Giraud





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

* bug#74364: Bug?
  2024-11-26 12:51                   ` Eli Zaretskii
@ 2024-11-26 18:43                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 12+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-26 18:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74364, tatsu.takamaro

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: 74364@debbugs.gnu.org
>> Date: Mon, 25 Nov 2024 20:10:49 +0100
>> From:  Manuel Giraud via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> Tatsu Takamaro <tatsu.takamaro@gmail.com> writes:
>> 
>> [...]
>> 
>> Ok, now your recipe is more precise and I can reproduce it.
>> 
>> > 3. Put some changes into the Tutorial. Say, just add a new line.
>> >
>> > 4. Press C-x-s to save. Emacs asks me to write a filename, I write
>> > TUTORIAL, because the full path is alredy shown. Then Emacs asks me
>> > whether I want to overwrite the file. I anser Yes (type y).
>> 
>> After this 'C-x C-s', you have saved the content of the (modified)
>> TUTORIAL into a file named "TUTORIAL" somewhere on your hard drive.
>> Now, in this buffer, `tutorial--lang' is set to nil (which cause the
>> error you saw) and Emacs still wants to save your progression in the
>> tutorial and that's why it asks the question when you tried to quit.
>> 
>> This is indeed a bug but maybe saving the TUTORIAL buffer is not
>> supported.  Or we should remap `save-buffer' to save tutorial
>> progression here?
>
> Saving TUTORIAL is a strange thing to do.  What is the purpose?  The
> file produced that way cannot be used as a tutorial, AFAIU, because
> Emacs doesn't let users specify the tutorial's file name.

It seems that at some point of the tutorial, the user is expected to do
it.

[...]

> So my suggestion would be to modify tutorial--save-tutorial and
> tutorial--save-on-kill such that of tutorial--lang is nil, they will
> do nothing.  Because there's no point of trying to save the tutorial
> in that case.

I could try to come up with a patch like this.
-- 
Manuel Giraud





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

end of thread, other threads:[~2024-11-26 18:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15  4:53 bug#74364: Bug? Tatsu Takamaro
2024-11-15  7:18 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <3ffa9049-44a1-8a88-69aa-6a7b1d5dabee@gmail.com>
2024-11-18  9:10     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19  8:50       ` Tatsu Takamaro
2024-11-19 14:23         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-23  6:44           ` Tatsu Takamaro
2024-11-23 10:50             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-25  8:21               ` Tatsu Takamaro
2024-11-25 19:10                 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-26 12:51                   ` Eli Zaretskii
2024-11-26 18:43                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                   ` <ab77c50d-6db1-b143-78cf-191c19585280@gmail.com>
2024-11-26 13:11                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors

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