GNU bug report logs - #11274
23.1; auto-save invoked in read-only directories

Previous Next

Package: emacs;

Reported by: <danh <at> mail.archive.org>

Date: Wed, 18 Apr 2012 22:32:01 UTC

Severity: minor

Merged with 18907

Found in versions 23.1, 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#11274: 23.1; auto-save invoked in read-only directories
Date: Thu, 19 Apr 2012 00:44:33 -0600
On 4/18/12 3:03 PM, danh <at> 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.)

(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))

> I am not the only person who has reported this problem to
> newsgroups, but i wasn't aware of the possibility of filing
> a bug from within emacs until Michael Heerdegen told me
> about it.
>
> (Note that emacs does not crash, and never has for me.  But
> the freezing happens to me, colleagues of mine, and people
> i've never heard of on the newsgroups.)
>
> dan  (danh <at> archive.org)

-- 
Kevin Rodgers
Denver, Colorado, USA





This bug report was last modified 3 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.