From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74364: Bug? Date: Fri, 29 Nov 2024 16:46:55 +0100 Message-ID: <87o71ycaa8.fsf@ledu-giraud.fr> References: <17252c4c-d318-9202-01a3-562d0d057bbe@gmail.com> <8734jtvub4.fsf@ledu-giraud.fr> <3ffa9049-44a1-8a88-69aa-6a7b1d5dabee@gmail.com> <87bjyc29ht.fsf@ledu-giraud.fr> <615dc98b-7d7e-67f2-f57d-f75f4de6c661@gmail.com> <87h683qp3r.fsf@ledu-giraud.fr> <654bc467-2f59-b585-eb4c-6f69344bd5a8@gmail.com> <87wmgu8brh.fsf@ledu-giraud.fr> <87iksb6see.fsf@ledu-giraud.fr> <86seregnul.fsf@gnu.org> <87mshl4z0n.fsf@ledu-giraud.fr> <86ttbsg3p9.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38300"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74364@debbugs.gnu.org, tatsu.takamaro@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 29 16:48:32 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tH3EN-0009po-9h for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Nov 2024 16:48:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH3Dy-0003rH-6i; Fri, 29 Nov 2024 10:48:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH3Dv-0003qS-O8 for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 10:48:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tH3Dv-000372-Fd for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 10:48:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=N4iDKChWtCGsYMp9JQzuaQleP/ZiELiWxdvRsPZNpHI=; b=vIKsNV+eJhmb5QWi7hVpm8RL9OxlQSs4LW5v/JeDkqKt3IHnX79sxRZCLndiz1TsQK2JkqSvirVdEmUrySbdKUoBIKo0kWDPD0GpsYsWw2q6Q7rPA8Dkq0Q0U16tkS/IaQAtukmPCmwxE2NcBx7uIJe+VD8GuRy+NhWW2+yaQEBkvw8xretUqD/yeMHEdpHrMdm+WA8onjVHOdYvQduSeLjf5x357uwEZ1IvnBBYYYQtR5Ty4eXRQvmiEJVq5cA/mvorQWve0I/lylPk1qKmp1Xco0Dy5nRhjIXVRDPYrbDrXHb64GJGjF3RpkJeUephVeVr8am39xXAHDDh1kuxag==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tH3Du-0007kp-9t for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 10:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Nov 2024 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74364 X-GNU-PR-Package: emacs Original-Received: via spool by 74364-submit@debbugs.gnu.org id=B74364.173289522229656 (code B ref 74364); Fri, 29 Nov 2024 15:48:02 +0000 Original-Received: (at 74364) by debbugs.gnu.org; 29 Nov 2024 15:47:02 +0000 Original-Received: from localhost ([127.0.0.1]:44120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tH3Cw-0007i2-12 for submit@debbugs.gnu.org; Fri, 29 Nov 2024 10:47:02 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:22331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tH3Cs-0007hm-IB for 74364@debbugs.gnu.org; Fri, 29 Nov 2024 10:47:00 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=x0T/XNdS lqcvaEPQqFuryaykqM2Sddx8Qe2TEjw6pU4=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=0DwdV5CKyiPCf9oueSY9lK+vX+2lnH 0IvngGzg/t/KN7bAbuldCQE7EAdN1w4YzWvDr/fafUnFEB7ygSt73AAA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=x0T/XNdSlqcvaEPQ qFuryaykqM2Sddx8Qe2TEjw6pU4=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=uhR1hArk+1DD0XKooLTIk8sPoprVpp20wRsULH MXeB48/ipr0pDK2Pyefz82qvGp/mKvuIu1lHrGwuHZenv8mfXso9pBXdAFTBv2wZsc1C6T Wi7fQB8jNLhpfTtynW/g09a1C6t+smWkMxXozu45bdkrzkso/TFc9CYw0oX9XFi9CNXNrn 8s7UkvU2gQdkBHyeGKYXN3oe25ZGp2mdICDoPSGrFEtx8vkxfoHWPA2mgReKSsuq/B88K4 +1YuvnATE5Qa/2AgWS99O2c/aGmx8KA85suOeCiteSX6ch7+pKVBk0zVzCbKhOTMKxo+Eg BRjv3Y84Li0OHsZnDWfCawCQ== Original-Received: from computer (2630.fr [82.65.148.221]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id e5172b2f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 29 Nov 2024 16:46:56 +0100 (CET) In-Reply-To: <86ttbsg3p9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Nov 2024 16:18:42 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296095 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: tatsu.takamaro@gmail.com, 74364@debbugs.gnu.org >> Date: Tue, 26 Nov 2024 19:43:04 +0100 >> >> Eli Zaretskii writes: >> >> > 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. > > Please do, and thanks. What about this? I have mimic it after your patch dec2ac0c657. I've tested it lightly and it seems to work as expected: - The user can save the TUTORIAL to a file - Trying to kill Emacs will ask if the user wants to save his progression. - The progression is correctly saved. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-exiting-Emacs-after-saving-a-tutorial.patch >From 407fbd578a171dbd746d6ee62d8c1e40c772978e Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 29 Nov 2024 16:35:47 +0100 Subject: [PATCH] Fix exiting Emacs after saving a tutorial * lisp/tutorial.el (tutorial--lang) (tutorial--point-before-chkeys): Add both variables as permanent-local, so that saving the tutorial to some file doesn't kill these buffer-local variables. Otherwise, trying to exit Emacs after saving the tutorial will signal an error, because 'tutorial--lang' is nil. (Bug#74364) --- lisp/tutorial.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index d754db238de..86537d995fe 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -650,7 +650,12 @@ tutorial--remove-remarks (delete-region prop-start prop-end)))))) (defvar tutorial--starting-point) + +;; For when the user saves the TUTORIAL to a file. (put 'tutorial--starting-point 'permanent-local t) +(put 'tutorial--lang 'permanent-local t) +(put 'tutorial--point-before-chkeys 'permanent-local t) + (defun tutorial--save-on-kill () "Query the user about saving the tutorial when killing Emacs." (when (buffer-live-p tutorial--buffer) -- 2.47.0 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--