From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: delete-selection-mode as default Date: Sun, 09 Sep 2018 02:11:18 +0300 Organization: LINKOV.NET Message-ID: <87tvmz62q1.fsf@mail.linkov.net> References: <83k1nxvm5j.fsf@gnu.org> <877ejxsm18.fsf@toy.adminart.net> <87r2i5308w.fsf@gmail.com> <8336ulv2le.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536452394 9820 195.159.176.226 (9 Sep 2018 00:19:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 00:19:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 09 02:19:50 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fynS8-0002Ry-Jp for ged-emacs-devel@m.gmane.org; Sun, 09 Sep 2018 02:19:48 +0200 Original-Received: from localhost ([::1]:45561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fynUF-0008Vn-2m for ged-emacs-devel@m.gmane.org; Sat, 08 Sep 2018 20:21:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fynSx-0008SQ-9J for emacs-devel@gnu.org; Sat, 08 Sep 2018 20:20:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fynDj-0002DS-3N for emacs-devel@gnu.org; Sat, 08 Sep 2018 20:04:57 -0400 Original-Received: from pop.dreamhost.com ([64.90.62.162]:59472 helo=pdx1-sub0-mail-a34.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fynDe-00026U-TT for emacs-devel@gnu.org; Sat, 08 Sep 2018 20:04:51 -0400 Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a34.g.dreamhost.com (Postfix) with ESMTP id 824467F3A0; Sat, 8 Sep 2018 17:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=8nqiOqB8EdPwa2fhKDWYVnXEiUM=; b= QOiY4hBASHuSxaiuhjwuUf8TSK5h4vnpCgiEfmnoV4IZqXka8ha8TqrFDcW4Upru SOavCLVlSIoB7CXGc9mvWmEUi+ZB8xfsKpnLqm5jhykTzZJ5AQgpFKFHeBnRvhYs +ElGCQVmD1iJO/lqsK4W72u3cGncN142MyvwA8jbJ1Q= Original-Received: from localhost.linkov.net (m91-129-107-190.cust.tele2.ee [91.129.107.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a34.g.dreamhost.com (Postfix) with ESMTPSA id D54997F39C; Sat, 8 Sep 2018 17:04:45 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 07 Sep 2018 10:22:55 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.90.62.162 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229526 Archived-At: > FWIW, while I personally don't use delete-selection-mode, I wouldn't > object to enabling it by default (I'd probably disable it in my .emacs, > but I'd first try to keep it enabled to see if I can change my habits). > > But before that I'd appreciate if we could improve its implementation so > it doesn't rely on pre-command-hook. Incidentally, yesterday I discovered a case when Wdired breaks delete-selection-mode. Selecting a file name in Wdired and starting to type its new name to completely replace an old name with a new one signals the error "No file on this line", then removes delete-selection-pre-hook from pre-command-hook while leaving delete-selection-mode still active, so delete-selection-mode becomes completely broken - it doesn't replace the selection anymore. I had to disable and then enable delete-selection-mode again to get delete-selection-pre-hook back to pre-command-hook. The error that removes delete-selection-pre-hook from pre-command-hook logged in *Messages* is: Error in pre-command-hook (delete-selection-pre-hook): (error "No file on this line") so relying on pre-command-hook is indeed the d-s-m's weak point.