Subject: Re: bug#29550: 27.0.50; `not-modified' should be disabled by default

From: Stefan Kangas <[email-masked]>
Date: Sun, 29 Sep 2019 02:06:55 +0200

tags 29550 + patch
quit

Lars Ingebrigtsen <[email-masked]> writes:

> Glenn Morris <[email-masked]> writes:
>
>> Previous times this came up:
>> http://lists.gnu.org/archive/html/bug-gnu-emacs/2005-04/msg00182.html
>> (a prolific and, err, idiosyncratic reporter)
>>
>> http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg00414.html
>> (previous maintainer)
>>
>> http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg00395.html
>> (previous+N maintainer)
>>
>> Obviously, this calls for a poll!
>>
>> (Please don't have a poll.)
>
> :-)
>
> I think it makes sense to have this command disabled by default.  It's a
> lot more dangerous than several of the other commands that are
> disabled...

I agree with Lars here, and Stefan Monnier in the above thread, that
it should be disabled.

I don't really understand the basic controversy here.  It should at
worst be a minor inconvenience for anyone who do wish to use it, while
it could save many other users some big headaches.

So I'll just jump in at the deep end and ask... Are there any
objections to the attached patch?

Best regards,
Stefan Kangas
From d676fbb543c04a7f258f564214812a627e609000 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Sun, 29 Sep 2019 02:02:06 +0200
Subject: [PATCH] Disable not-modified command by default

* lisp/files.el (not-modified): Disable command by
default.  (Bug#29550)
---
 lisp/files.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/files.el b/lisp/files.el
index 09180fd555..f3bb23738d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5537,6 +5537,9 @@ clear-visited-file-modtime
 Next attempt to save will not complain of a discrepancy."
   (set-visited-file-modtime 0))
 
+;; This command could cause data loss for unsuspecting users.
+(put 'not-modified 'disabled t)
+
 (defun not-modified (&optional arg)
   "Mark current buffer as unmodified, not needing to be saved.
 With prefix ARG, mark buffer as modified, so \\[save-buffer] will save.
-- 
2.20.1