unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: <filename> changed on disk; really edit the buffer?
       [not found]                                 ` <18242.27013.59638.550831@tower.localdomain>
@ 2007-11-21 12:03                                   ` Richard Stallman
  2007-11-21 12:55                                     ` jonathangoldblatt
  2007-11-21 17:47                                     ` martin rudalics
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Stallman @ 2007-11-21 12:03 UTC (permalink / raw)
  To: jonathangoldblatt; +Cc: stephan.lukits, rudalics, emacs-devel

    Also occurred to me that a possible use for auto-saving into the
    current file is when you don't have enough permissions in the
    current directory to create a new file.  

I think it would be better to put the auto save file in a different
directory.  In fact, perhaps we should change make-auto-save-file-name
to do this automatically.

Would someone like to try this?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: <filename> changed on disk; really edit the buffer?
  2007-11-21 12:03                                   ` <filename> changed on disk; really edit the buffer? Richard Stallman
@ 2007-11-21 12:55                                     ` jonathangoldblatt
  2007-11-22 16:21                                       ` Richard Stallman
  2007-11-21 17:47                                     ` martin rudalics
  1 sibling, 1 reply; 5+ messages in thread
From: jonathangoldblatt @ 2007-11-21 12:55 UTC (permalink / raw)
  To: rms; +Cc: stephan.lukits, rudalics, jonathangoldblatt, emacs-devel

What did you think of the auto-save-hooks idea?  In GNU Emacs
21.4.1 there is just 

auto-save-hook's value is nil

Documentation:
Normal hook run just before auto-saving.

Another possible advantage of auto-saving into the file is that
it simplifies using session-recover if something does go wrong.
I have one file that always shows up with an auto-save file and
what I always wind up doing is a compare with the original to
check that I really want to do the replace, which I always do.
Just struck me that I maybe I should set this file to save into
itself.  Unfortunately, it's a largish .gz, that takes a while to
save, but I might decide to stop being a bit miser, and just
use a normal file.  

I'd like to do some work on this stuff, and some of the other TO
DO's but unfortunately my personal life doesn't leave me with
enough time.  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: <filename> changed on disk; really edit the buffer?
  2007-11-21 12:03                                   ` <filename> changed on disk; really edit the buffer? Richard Stallman
  2007-11-21 12:55                                     ` jonathangoldblatt
@ 2007-11-21 17:47                                     ` martin rudalics
  2007-11-22  8:22                                       ` Richard Stallman
  1 sibling, 1 reply; 5+ messages in thread
From: martin rudalics @ 2007-11-21 17:47 UTC (permalink / raw)
  To: rms; +Cc: stephan.lukits, jonathangoldblatt, emacs-devel

 >     Also occurred to me that a possible use for auto-saving into the
 >     current file is when you don't have enough permissions in the
 >     current directory to create a new file.
 >
 > I think it would be better to put the auto save file in a different
 > directory.  In fact, perhaps we should change make-auto-save-file-name
 > to do this automatically.

`make-auto-save-file-name' already tries to substitute the
default-directory in


		    (expand-file-name
		     (format "#%s#" buffer-name)
		     ;; Try a few alternative directories, to get one we can
		     ;; write it.
		     (cond
		      ((file-writable-p default-directory) default-directory)
		      ((file-writable-p "/var/tmp/") "/var/tmp/")
		      ("~/")))))

What else should it do?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: <filename> changed on disk; really edit the buffer?
  2007-11-21 17:47                                     ` martin rudalics
@ 2007-11-22  8:22                                       ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2007-11-22  8:22 UTC (permalink / raw)
  To: martin rudalics; +Cc: stephan.lukits, jonathangoldblatt, emacs-devel

    `make-auto-save-file-name' already tries to substitute the
    default-directory in

			(expand-file-name
			 (format "#%s#" buffer-name)
			 ;; Try a few alternative directories, to get one we can
			 ;; write it.
			 (cond
			  ((file-writable-p default-directory) default-directory)

That is in the branch for non-file buffers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: <filename> changed on disk; really edit the buffer?
  2007-11-21 12:55                                     ` jonathangoldblatt
@ 2007-11-22 16:21                                       ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2007-11-22 16:21 UTC (permalink / raw)
  To: jonathangoldblatt
  Cc: stephan.lukits, rudalics, jonathangoldblatt, emacs-devel

The idea makes sense.  The variables should be named
auto-save-functions, according to conventions since 15 years ago.

But it isn't quite straightforward, because the code in fileio.c uses
a static variable auto_saving which alters the behavior of
write-region.

We do theoretically have a problem with this now, since the call to
Fsleep_for could run a process filter or sentinel.  So it would be
good to change that mechanism.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-22 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fg7idt$2c1$1@tamarack.fernuni-hagen.de>
     [not found] ` <mailman.2766.1193775394.18990.bug-gnu-emacs@gnu.org>
     [not found]   ` <fga6u2$kav$1@tamarack.fernuni-hagen.de>
     [not found]     ` <mailman.2810.1193861188.18990.bug-gnu-emacs@gnu.org>
     [not found]       ` <fgq1js$sae$1@tamarack.fernuni-hagen.de>
     [not found]         ` <mailman.3057.1194380790.18990.bug-gnu-emacs@gnu.org>
     [not found]           ` <fgv8a9$2tq$1@tamarack.fernuni-hagen.de>
     [not found]             ` <mailman.3145.1194554809.18990.bug-gnu-emacs@gnu.org>
     [not found]               ` <fh9s10$461$1@tamarack.fernuni-hagen.de>
     [not found]                 ` <mailman.3374.1194901774.18990.bug-gnu-emacs@gnu.org>
     [not found]                   ` <fhbptp$qfk$1@tamarack.fernuni-hagen.de>
     [not found]                     ` <mailman.3422.1194947662.18990.bug-gnu-emacs@gnu.org>
     [not found]                       ` <fhbt7q$j4d$1@tamarack.fernuni-hagen.de>
     [not found]                         ` <4739B12F.7000400@gmx.at>
     [not found]                           ` <E1Itjli-000760-SD@fencepost.gnu.org>
     [not found]                             ` <18241.34220.668384.165761@tower.localdomain>
     [not found]                               ` <E1IuKHL-000080-4R@fencepost.gnu.org>
     [not found]                                 ` <18242.27013.59638.550831@tower.localdomain>
2007-11-21 12:03                                   ` <filename> changed on disk; really edit the buffer? Richard Stallman
2007-11-21 12:55                                     ` jonathangoldblatt
2007-11-22 16:21                                       ` Richard Stallman
2007-11-21 17:47                                     ` martin rudalics
2007-11-22  8:22                                       ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).