From aamann@tyndall.ie Fri Oct 24 03:53:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=BAYES_00,FOURLA, IMPRONONCABLE_2,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 24 Oct 2008 10:53:50 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9OArjsl031920 for ; Fri, 24 Oct 2008 03:53:47 -0700 Received: from mail.gnu.org ([199.232.76.166]:37986 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KtKFx-0005ig-7s for emacs-pretest-bug@gnu.org; Fri, 24 Oct 2008 06:51:01 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KtKIX-0003AW-07 for emacs-pretest-bug@gnu.org; Fri, 24 Oct 2008 06:53:43 -0400 Received: from nmrc.ucc.ie ([143.239.64.1]:51248) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtKIW-00032W-H4 for emacs-pretest-bug@gnu.org; Fri, 24 Oct 2008 06:53:40 -0400 Received: from unixmail.tyndall.ie (unixmail.tyndall.ie [10.1.64.22]) by nmrc.ucc.ie (Postfix) with ESMTP id 31BBCEF for ; Fri, 24 Oct 2008 11:54:23 +0100 (IST) Received: from localhost (localhost [127.0.0.1]) by unixmail.tyndall.ie (Postfix) with ESMTP id 01FE54E8EC for ; Fri, 24 Oct 2008 11:53:15 +0100 (IST) X-Virus-Scanned: amavisd-new at tyndall.ie Received: from unixmail.tyndall.ie ([127.0.0.1]) by localhost (unixmail.tyndall.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KivLvIN4+XI7 for ; Fri, 24 Oct 2008 11:53:04 +0100 (IST) Received: from localhost.localdomain (lnx0015f2465ec6.tyndall.ie [10.1.65.107]) by unixmail.tyndall.ie (Postfix) with ESMTP id 8C9384E8E4 for ; Fri, 24 Oct 2008 11:53:04 +0100 (IST) Received: from localhost.localdomain (lnx0015f2465ec6 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id m9OAr4IO026783 for ; Fri, 24 Oct 2008 11:53:04 +0100 Date: Fri, 24 Oct 2008 11:53:00 +0100 Message-Id: <200810241053.m9OAr0P8026782@localhost.localdomain> From: "andreas.amann" To: emacs-pretest-bug@gnu.org Subject: 23.0.60; ido-write-file makes it easy to overwrite files unintentionally X-detected-operating-system: by monty-python.gnu.org: Solaris 9 I am often using the C-x C-w shortcut to save a buffer into a different directory, usually without changing it's name. The standard write-file works well for this, since after selecting the appropriate directory, I simply hit return, and the file gets saved where I want it, without a change in the name by default. However, since I switched to ido-mode and ido-write-file I found that after navigating to a directory, which does not contain any subdirectories, the first filename in that directory gets selected as the filename, into which to write the contents of the active buffer. This has several times already caused me to overwrite a file with the current buffer by accident, since after selecting the appropriate directory, I was not noticing the selection and wrongly assumed that emacs would simply write the file into this directory with the old filename. After hitting return however the active buffer would be written into this first file of the directory. I know I can simply work around this by binding C-x C-w to write-file, but in my opinion, ido-write-file should be changed in a way which makes it more difficult to overwrite a file. I would expect that C-x C-w is used for more often to create a new file, than to overwrite an existing one. Therefore in my opinion the current behaviour of ido-write-file to select the first file in the directory only serves a minority of use-cases. In GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars) of 2008-10-20 on lnx0015f2465ec6 Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--prefix=/home/aamann/local/emacs-cvs' 'LDFLAGS=-L/home/aamann/local/lib64' 'CPPFLAGS=-I/home/aamann/local/include'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_IE.utf8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x i d o - m o d C-x C-w C-g M-x w r i t e - f C-g M-x i d o - w r i C-g C-x C-w C-g C-h C-b C-h b C-x o C-s w r i t e C-x o M-x w e m e m a c s b b u g r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Ido mode enabled Quit [4 times] Type C-x 1 to delete the help window, C-M-v to scroll help. Mark saved where search started Making completion list... [2 times] From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 14:23:37 2010 Received: (at control) by debbugs.gnu.org; 24 Jun 2010 18:23:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORr5N-00051L-8v for submit@debbugs.gnu.org; Thu, 24 Jun 2010 14:23:37 -0400 Received: from pantheon-po41.its.yale.edu ([130.132.50.98]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORr5K-00051G-K0 for control@debbugs.gnu.org; Thu, 24 Jun 2010 14:23:35 -0400 Received: from furry (dhcp128036014221.central.yale.edu [128.36.14.221]) (authenticated bits=0) by pantheon-po41.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o5OINUI2013527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 24 Jun 2010 14:23:30 -0400 Received: by furry (Postfix, from userid 1000) id 5BF4B16D416; Thu, 24 Jun 2010 20:23:29 +0200 (CEST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 1382 Date: Thu, 24 Jun 2010 14:23:29 -0400 Message-ID: <87r5jw5ly6.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) severity 135 minor tags 710 + moreinfo unreproducible close 756 tags 844 + moreinfo unreproducible close 917 close 1000 tags 1125 + moreinfo unreproducible close 1159 severity 1238 wishlist close 1247 close 1381 close 1382 tags 1708 + moreinfo unreproducible close 1993 severity 2024 wishlist close 2236 severity 2299 wishlist tags 2394 + moreinfo unreproducible severity 2507 minor close 2583 tags 2690 + moreinfo unreproducible tags 2812 + moreinfo unreproducible tags 2843 + moreinfo unreproducible tags 2870 + moreinfo unreproducible tags 2877 + moreinfo unreproducible close 3032 close 3273 close 3349 close 4046 close 4358 close 4591 close 4656 thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 13 09:52:57 2010 Received: (at 1238) by debbugs.gnu.org; 13 Nov 2010 14:52:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHHTM-0001tY-Tx for submit@debbugs.gnu.org; Sat, 13 Nov 2010 09:52:57 -0500 Received: from mail-vw0-f44.google.com ([209.85.212.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHHTL-0001tT-2V for 1238@debbugs.gnu.org; Sat, 13 Nov 2010 09:52:55 -0500 Received: by vws8 with SMTP id 8so995064vws.3 for <1238@debbugs.gnu.org>; Sat, 13 Nov 2010 06:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=5Vs8yomfxVVKfcHzGoHdTDFjhW7Bi6ifZ7p+WViqVKE=; b=aNNwuqG8u+tjuRy6IG/vkazb3kuLGXJaH56HRsS95ZwhaLijRA09i4bL7rQQfU8rJo 23TtckE4avv6lllnpgcBmmQilfN/uCfMoYMisTthpVdUHNEpbzYaYvruYEAykgzPKI1v acEbcDWZDoFdMV4UTmhuR4POqenQKlBb8IbSw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=v+Bv7gisAh6XxB0/gCeBKllg5WyvMPf6wB5XoJPodzpQk/bUsUqk3FX3m2RfyiQdAl Ojar/woOVBTrES8tHM4vHFSkF1QakAuZMVy2LD41m0BDwa8ZF1vE15QvF0ekfPj8HXVf RFS41i1UbXbjswQKF7bpg7uqHM74pr6KeIwTY= Received: by 10.220.189.11 with SMTP id dc11mr903470vcb.39.1289660266033; Sat, 13 Nov 2010 06:57:46 -0800 (PST) Received: from [192.168.1.28] (cpe-74-74-249-54.rochester.res.rr.com [74.74.249.54]) by mx.google.com with ESMTPS id o17sm1639698vbi.2.2010.11.13.06.57.44 (version=SSLv3 cipher=RC4-MD5); Sat, 13 Nov 2010 06:57:45 -0800 (PST) Message-ID: <4CDEA766.50302@gmail.com> Date: Sat, 13 Nov 2010 09:57:42 -0500 From: Ryan Twitchell User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101031 Lightning/1.0b3pre Thunderbird/3.1.6 MIME-Version: 1.0 To: 1238@debbugs.gnu.org Subject: Re: ido-write-file makes it easy to overwrite files unintentionally Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 1238 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) I encountered this problem independently in version 23.2.1, and think I have a very simple fix. As a drop in replacement for write-file, ido-write-file does not prompt the user for confirmation when overwriting an existing file: Steps to reproduce: $ emacs -Q M-x emacs-version "GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-11-07 on falconsrevenge" M-x ido-mode C-x C-f new-file ...editing C-x C-s C-x C-b new-buffer ...editing C-x C-w new-file OR M-x ido-write-filenew-file ...prompt expected here, but new-file is overwritten. The function ido-file-internal uses plain old write-file to carry out this action: Line 2382: ((eq method 'write) (ido-record-work-file filename) (setq default-directory ido-current-directory) (setq filename (concat ido-current-directory filename)) (ido-record-command 'write-file filename) (add-to-history 'file-name-history filename) (ido-record-work-directory) (write-file filename)) ido functions are primarily for interactive use, so it seems safe to pass a true value to write-file's CONFIRM arg (on the last line above) to always enable prompting: (write-file filename t) A quick test confirmed this change added the expected behavior. Ryan Twitchell From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 17 05:50:09 2010 Received: (at 1238) by debbugs.gnu.org; 17 Dec 2010 10:50:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTXt3-0005Z0-Eo for submit@debbugs.gnu.org; Fri, 17 Dec 2010 05:50:09 -0500 Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTXt1-0005Yc-72 for 1238@debbugs.gnu.org; Fri, 17 Dec 2010 05:50:07 -0500 Received: from furball (bb121-6-218-24.singnet.com.sg [121.6.218.24]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id oBHAuOJO008274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 17 Dec 2010 05:56:27 -0500 Received: by furball (Postfix, from userid 1000) id F3166161F11; Fri, 17 Dec 2010 05:56:21 -0500 (EST) From: Chong Yidong To: Ryan Twitchell Subject: Re: bug#1238: ido-write-file makes it easy to overwrite files unintentionally References: <200810241053.m9OAr0P8026782@localhost.localdomain> <4CDEA766.50302@gmail.com> Date: Fri, 17 Dec 2010 18:56:21 +0800 In-Reply-To: <4CDEA766.50302@gmail.com> (Ryan Twitchell's message of "Sat, 13 Nov 2010 09:57:42 -0500") Message-ID: <87oc8k3bxm.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 1238 Cc: 1238@debbugs.gnu.org, "andreas.amann" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Ryan Twitchell writes: > I encountered this problem independently in version 23.2.1, and think > I have a very simple fix. > > As a drop in replacement for write-file, ido-write-file does not > prompt the user for confirmation when overwriting an existing file: > > The function ido-file-internal uses plain old write-file to carry out > this action: > > ido functions are primarily for interactive use, so it seems safe to > pass a true value to write-file's CONFIRM arg (on the last line above) > to always enable prompting: > > (write-file filename t) > > A quick test confirmed this change added the expected behavior. Sounds reasonable. I've committed a fix following your suggestion; thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 17 05:50:22 2010 Received: (at control) by debbugs.gnu.org; 17 Dec 2010 10:50:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTXtF-0005ZN-NW for submit@debbugs.gnu.org; Fri, 17 Dec 2010 05:50:21 -0500 Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTXtE-0005ZC-8M for control@debbugs.gnu.org; Fri, 17 Dec 2010 05:50:20 -0500 Received: from furball (bb121-6-218-24.singnet.com.sg [121.6.218.24]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id oBHAucic008295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 17 Dec 2010 05:56:40 -0500 Received: by furball (Postfix, from userid 1000) id C1820161F11; Fri, 17 Dec 2010 05:56:35 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 1238 Date: Fri, 17 Dec 2010 18:56:35 +0800 Message-ID: <87mxo4acrg.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) close 1238 thanks From unknown Mon Jun 23 20:20:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 14 Jan 2011 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator