From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: Re: New feature? Remove duplicate subheadings, preserving order Date: Tue, 2 Jan 2018 13:22:23 -0800 Message-ID: References: <87a7xxx5c5.fsf@nicolasgoaziou.fr> <87tvw5cu5t.fsf@nicolasgoaziou.fr> <87mv1wvr70.fsf@alphapapa.net> <87r2r8w73n.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWU0v-0007E2-Rj for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:22:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWU0u-00014k-VX for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:22:25 -0500 Received: from mail-qt0-x234.google.com ([2607:f8b0:400d:c0d::234]:35027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWU0u-00014S-RN for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:22:24 -0500 Received: by mail-qt0-x234.google.com with SMTP id u10so64642252qtg.2 for ; Tue, 02 Jan 2018 13:22:24 -0800 (PST) In-Reply-To: <87r2r8w73n.fsf@alphaville.usersys.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nick Dokos Cc: emacs-orgmode@gnu.org On Tue, Jan 2, 2018 at 8:36 AM, Nick Dokos wrote: > Allen Li writes: >> >> There is always undo and automatic Emacs file backups. >> > > There be dragons. > > The problem is that some things happen invisibly and far away from > where you are, so you don't know about it and you don't find out for a > couple of weeks. Undo and automatic backups are useless in that case. > > That *has* happened: there have been multiple postings in the ML about > such problems. Whenever it has happened, the devs have always modified > org to make it safer: that is the prudent thing to do and the correct > course of action IMO. > > Hell hath no fury like an orgmode user who lost part of his/her > precious org file because of an errant keystroke a month ago and was > not aware of the loss until it was too late. I can see where you're coming from, but for me there are various reasons why I don=E2=80=99t think warning is right: 1. org-sort-entries, which performs an action of similar scope and destructiveness, does not need to warn so far. 2. Since I see the only use case for warning is checking beforehand, a user that uses this command frequently is not going to type C-c d C-u C-c d every time (assuming the user has bound this command to C-c d), they=E2=80=99re just going to type C-u C-c d or get frustrated and just = bind the actual command without warning to C-c d. So warning provides zero safety in practice. Another possibility is using a y or n confirmation prompt before removing duplicates, however this falls into the same trap that a user who uses this frequently is just going to bind the command to a key and disable this check. 3. I don=E2=80=99t propose binding this command to any key by default, and = I don=E2=80=99t think M-x org-remove-duplicates RET is a very common typo. 4. The only commands in Emacs that warn beforehand are truly irreversible commands, like deleting in Dired or killing a buffer. Everything else in Emacs follows the philosophy of using undo if the user makes a mistake, including lots of commands that could have unintentional, low visibility effects. I would prefer following this policy unless it proves to actually be a problem. It seems like org-sort-entries in practice has not suffered from this problem, so I believe a remove duplicates command will similarly not suffer from this problem in practice. 5. Everyone should be keeping reliable backups. This is reiterated all the time, yet no one seems to follow it? =3D) > > -- > Nick > >