From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#11274: 23.1; auto-save invoked in read-only directories Date: Fri, 20 Apr 2012 03:06:04 +0200 Message-ID: <87lilrnrer.fsf@web.de> References: <1334783017.019980.2631.nullmailer@vm-home1.us.archive.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1334883890 25704 80.91.229.3 (20 Apr 2012 01:04:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2012 01:04:50 +0000 (UTC) Cc: 11274@debbugs.gnu.org To: Kevin Rodgers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 20 03:04:49 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SL2HI-0002BM-Fm for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Apr 2012 03:04:48 +0200 Original-Received: from localhost ([::1]:37648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SL2HH-00065L-MU for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Apr 2012 21:04:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SL2HD-000653-QE for bug-gnu-emacs@gnu.org; Thu, 19 Apr 2012 21:04:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SL2HC-0007Bg-1b for bug-gnu-emacs@gnu.org; Thu, 19 Apr 2012 21:04:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SL2HB-0007Bc-U8 for bug-gnu-emacs@gnu.org; Thu, 19 Apr 2012 21:04:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SL2HX-0008D2-00 for bug-gnu-emacs@gnu.org; Thu, 19 Apr 2012 21:05:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Apr 2012 01:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11274-submit@debbugs.gnu.org id=B11274.133488388231528 (code B ref 11274); Fri, 20 Apr 2012 01:05:02 +0000 Original-Received: (at 11274) by debbugs.gnu.org; 20 Apr 2012 01:04:42 +0000 Original-Received: from localhost ([127.0.0.1]:42999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL2HB-0008CT-TL for submit@debbugs.gnu.org; Thu, 19 Apr 2012 21:04:42 -0400 Original-Received: from fmmailgate05.web.de ([217.72.192.243]:53747) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL2H7-0008CE-0X for 11274@debbugs.gnu.org; Thu, 19 Apr 2012 21:04:38 -0400 Original-Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate05.web.de (Postfix) with ESMTP id 46B3E6DE6E74 for <11274@debbugs.gnu.org>; Fri, 20 Apr 2012 03:04:09 +0200 (CEST) Original-Received: from snow.dragon ([89.204.137.12]) by smtp.web.de (mrweb002) with ESMTPA (Nemesis) id 0MSJ0V-1SoV7k26I7-00TVGw; Fri, 20 Apr 2012 03:04:08 +0200 In-Reply-To: (Kevin Rodgers's message of "Thu, 19 Apr 2012 00:44:33 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Provags-ID: V02:K0:9zDvzsNVWHF6yva1apSM7fZBBqTt2UAkfja5nwtOIlp sspYq5mXqXxbsjNBvm0MHI0Lm5U7c2O0fBSosN2ABExo3xmopF ShNDg5AQi4f2Qxfs8jtT+dp8+jjEVEFlHssFXqZOYxo7TyaQNT GNRboZhy+nGbXgU1dAvO+OLdKzsxwI0F6UAIZvKOKYQyhA98Lx +LyMqF8Cf1C8WNZluYgxP8M50axVoIe/tM83qy0Vw4= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59284 Archived-At: Hello Kevin, > On 4/18/12 3:03 PM, danh@mail.archive.org wrote: > > When i edit a file in a directory to which i do not have > > write-permission (such as /etc), after i type a line or > > two of text, or type a few characters and then move around > > in the buffer, emacs will suddenly freeze and just print > > a message in the mini-buffer that my text could not be auto-saved. > > > > The message stays up for several seconds before it > > yields control of the terminal back to me. > > > > This is extremely inconvenient, and the only way i can > > prevent this from happening is to frequently save the file. > > These statements seem contradictory to me: > > > I do not want to turn auto-save off, or to mark any buffers > ^^^^^^^^^^^^^^^^^^^^^^ > > as to not be auto-saved, or to change the location of the > ^^^^^^^^^^^^^^^^^^^^^^^ > > auto-saves (unless it can be done once and forever, only > > apply to files in write-protected directories and no others, > > and not require a listing of either the files or directories > > to which it is to be applied). > > > > The desired behavior is that emacs recognize that a directory > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > is write-protected, and if an attempt to write to that directory > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > fails, that it fail silently. (It would be quite OK to have > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > this governed by the behavior of a variable set in my .emacs file.) He means that he doesn't want to have to intervene in any form. He wants that Emacs turns off auto saving for the file when it's not possible to auto-save. > =EF=BB=BF=EF=BB=BF=EF=BB=BF(add-hook 'find-file-hook > (lambda () (when (file-writable-p > (file-name-directory buffer-file-name)) > (auto-save-mode 0)))) > > (add-hook 'find-file-not-found-functions > (lambda () (when (file-writable-p > (file-name-directory buffer-file-name)) > (auto-save-mode 0)) > ;; don't short-circuit run-hook-with-args-until-success: > nil)) Yes, something like that works no doubt (I think you mean (not (file-writable-p ...)) ). In addition, there should be a warning for the user. But something like that should not have to be done in the user's configuration. The current behavior of Emacs makes no sense at all. It continues to try to autosave, fails every time, beeps and beeps and shows messages. This is not only very annoying, it does not make any sense at all - it has no benefit for the user. So, can we add something like the above code to Emacs? Michael.