all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Creating an empty file
       [not found] ` <87odopr8ga.fsf@lrde.org>
@ 2007-01-23 16:35   ` Jay Belanger
  2007-01-23 16:48     ` David Kastrup
  2007-01-23 16:49     ` Leo
  0 siblings, 2 replies; 23+ messages in thread
From: Jay Belanger @ 2007-01-23 16:35 UTC (permalink / raw)
  Cc: belanger


michael@cadilhac.name (Michaël Cadilhac) writes:

> David Kastrup <dak@gnu.org> writes:
>
>> If I do
>> C-x C-f somefile.txt RET C-x C-s
>> in order to create and save an empty file, Emacs replies
>>
>> No changes need to be saved
>>
>> and does not actually save the file, even though saving the file would
>> change the state on disk.
>
> I can't reproduce it.

I can, even with emacs -Q.
It seems natural, if possibly incorrect, behavior.
If this is regarded as a bug, I would expect that an unchanged empty
file would be treated as a special case for C-xC-s.

Jay

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

* Re: Creating an empty file
  2007-01-23 16:35   ` Creating an empty file Jay Belanger
@ 2007-01-23 16:48     ` David Kastrup
  2007-01-23 17:19       ` Jay Belanger
  2007-01-23 18:20       ` Michaël Cadilhac
  2007-01-23 16:49     ` Leo
  1 sibling, 2 replies; 23+ messages in thread
From: David Kastrup @ 2007-01-23 16:48 UTC (permalink / raw)
  Cc: emacs-devel

Jay Belanger <belanger@truman.edu> writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>
>> David Kastrup <dak@gnu.org> writes:
>>
>>> If I do
>>> C-x C-f somefile.txt RET C-x C-s
>>> in order to create and save an empty file, Emacs replies
>>>
>>> No changes need to be saved
>>>
>>> and does not actually save the file, even though saving the file would
>>> change the state on disk.
>>
>> I can't reproduce it.
>
> I can, even with emacs -Q.

I think Michaël assumed that I meant to open an _existing_ file.  That
does not make sense in connection with my report, but when just
glancing over it, one might make this mistake.

> It seems natural, if possibly incorrect, behavior.
> If this is regarded as a bug, I would expect that an unchanged empty
> file would be treated as a special case for C-xC-s.

This is more about an unchanged _new_ file (it need not be empty if
some template mechanism has filled in material already, and it is ok
not to save if the empty file existed already).

This would probably also apply for an existing file that has been
changed on disk, but not in the Emacs buffer.  In this case it might
possibly make sense to ask the "revert buffer" question before saving.
In the case of a non-existing file, there is nothing to revert to,
however.

-- 
David Kastrup

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

* Re: Creating an empty file
  2007-01-23 16:35   ` Creating an empty file Jay Belanger
  2007-01-23 16:48     ` David Kastrup
@ 2007-01-23 16:49     ` Leo
  2007-01-23 17:11       ` David Kastrup
  2007-01-23 21:57       ` Phil Jackson
  1 sibling, 2 replies; 23+ messages in thread
From: Leo @ 2007-01-23 16:49 UTC (permalink / raw)


On 2007-01-23, Jay Belanger said:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>
>> David Kastrup <dak@gnu.org> writes:
>>
>>> If I do
>>> C-x C-f somefile.txt RET C-x C-s
>>> in order to create and save an empty file, Emacs replies
>>>
>>> No changes need to be saved
>>>
>>> and does not actually save the file, even though saving the file would
>>> change the state on disk.
>>
>> I can't reproduce it.
>
> I can, even with emacs -Q.
> It seems natural, if possibly incorrect, behavior.

I like this behavior. I prevent me from creating empty files.

> If this is regarded as a bug, I would expect that an unchanged empty
> file would be treated as a special case for C-xC-s.
>
> Jay

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: Creating an empty file
  2007-01-23 16:49     ` Leo
@ 2007-01-23 17:11       ` David Kastrup
  2007-01-23 21:57       ` Phil Jackson
  1 sibling, 0 replies; 23+ messages in thread
From: David Kastrup @ 2007-01-23 17:11 UTC (permalink / raw)
  Cc: emacs-devel

Leo <sdl.web@gmail.com> writes:

> On 2007-01-23, Jay Belanger said:
>
>> michael@cadilhac.name (Michaël Cadilhac) writes:
>>
>>> David Kastrup <dak@gnu.org> writes:
>>>
>>>> If I do
>>>> C-x C-f somefile.txt RET C-x C-s
>>>> in order to create and save an empty file, Emacs replies
>>>>
>>>> No changes need to be saved
>>>>
>>>> and does not actually save the file, even though saving the file would
>>>> change the state on disk.
>>>
>>> I can't reproduce it.
>>
>> I can, even with emacs -Q.
>> It seems natural, if possibly incorrect, behavior.
>
> I like this behavior. I prevent me from creating empty files.

Why would you type C-x C-s if you do not want to save the file?

-- 
David Kastrup

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

* Re: Creating an empty file
  2007-01-23 16:48     ` David Kastrup
@ 2007-01-23 17:19       ` Jay Belanger
  2007-01-23 17:23         ` David Kastrup
  2007-01-23 17:57         ` Michaël Cadilhac
  2007-01-23 18:20       ` Michaël Cadilhac
  1 sibling, 2 replies; 23+ messages in thread
From: Jay Belanger @ 2007-01-23 17:19 UTC (permalink / raw)
  Cc: belanger


David Kastrup <dak@gnu.org> writes:
...
> This would probably also apply for an existing file that has been
> changed on disk, but not in the Emacs buffer.  In this case it might
> possibly make sense to ask the "revert buffer" question before saving.
> In the case of a non-existing file, there is nothing to revert to,
> however.

So are you suggesting that when saving a file whose buffer has not
been changed, that Emacs should compare it to the disk file anyhow?
I had always (always=for the last 10 seconds) thought that it didn't
for efficiency reasons.

Jay

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

* Re: Creating an empty file
  2007-01-23 17:19       ` Jay Belanger
@ 2007-01-23 17:23         ` David Kastrup
  2007-01-23 17:57         ` Michaël Cadilhac
  1 sibling, 0 replies; 23+ messages in thread
From: David Kastrup @ 2007-01-23 17:23 UTC (permalink / raw)
  Cc: emacs-devel

Jay Belanger <belanger@truman.edu> writes:

> David Kastrup <dak@gnu.org> writes:
> ...
>> This would probably also apply for an existing file that has been
>> changed on disk, but not in the Emacs buffer.  In this case it might
>> possibly make sense to ask the "revert buffer" question before saving.
>> In the case of a non-existing file, there is nothing to revert to,
>> however.
>
> So are you suggesting that when saving a file whose buffer has not
> been changed, that Emacs should compare it to the disk file anyhow?
> I had always (always=for the last 10 seconds) thought that it didn't
> for efficiency reasons.

That would assume that attempting to save an unchanged file is a
frequent operation.  I doubt that.

-- 
David Kastrup

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

* Re: Creating an empty file
  2007-01-23 17:19       ` Jay Belanger
  2007-01-23 17:23         ` David Kastrup
@ 2007-01-23 17:57         ` Michaël Cadilhac
  2007-01-23 23:56           ` David Kastrup
  2007-01-24  2:58           ` Giorgos Keramidas
  1 sibling, 2 replies; 23+ messages in thread
From: Michaël Cadilhac @ 2007-01-23 17:57 UTC (permalink / raw)
  Cc: emacs-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 808 bytes --]

Jay Belanger <belanger@truman.edu> writes:

> David Kastrup <dak@gnu.org> writes:
> ...
>> This would probably also apply for an existing file that has been
>> changed on disk, but not in the Emacs buffer.  In this case it might
>> possibly make sense to ask the "revert buffer" question before saving.
>> In the case of a non-existing file, there is nothing to revert to,
>> however.
>
> So are you suggesting that when saving a file whose buffer has not
> been changed, that Emacs should compare it to the disk file anyhow?
> I had always (always=for the last 10 seconds) thought that it didn't
> for efficiency reasons.

Well, the modification flag has a certain use that should be
preserved. What may be done is to add a var
`new-files-are-already-modified'.

Maybe the (untested) following could help?


[-- Attachment #1.1.2: files.patch --]
[-- Type: text/x-patch, Size: 2083 bytes --]

Index: lisp/files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.879
diff -c -r1.879 files.el
*** lisp/files.el	21 Jan 2007 03:53:11 -0000	1.879
--- lisp/files.el	23 Jan 2007 17:56:38 -0000
***************
*** 1751,1756 ****
--- 1751,1764 ----
  \f
  (defvar after-find-file-from-revert-buffer nil)
  
+ (defcustom new-files-are-already-modified nil
+   "Non-nil means that new files are set to be modified.
+ This can be useful if you want to create empty files without actually
+ modify the buffer."
+   :group 'files
+   :version "22.1"
+   :type 'boolean)
+ 
  (defun after-find-file (&optional error warn noauto
  				  after-find-file-from-revert-buffer
  				  nomodes)
***************
*** 1787,1793 ****
  		  (format "%s has auto save data; consider M-x recover-this-file"
  			  (file-name-nondirectory buffer-file-name))
  		(setq not-serious t)
! 		(if error "(New file)" nil)))
  	     ((not error)
  	      (setq not-serious t)
  	      "Note: file is write protected")
--- 1795,1804 ----
  		  (format "%s has auto save data; consider M-x recover-this-file"
  			  (file-name-nondirectory buffer-file-name))
  		(setq not-serious t)
! 		(when error
! 		  (when new-files-are-already-modified
! 		    (set-buffer-modified-p 'set))
! 		  "(New file)")))
  	     ((not error)
  	      (setq not-serious t)
  	      "Note: file is write protected")
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10592
diff -C0 -r1.10592 ChangeLog
*** lisp/ChangeLog	23 Jan 2007 07:18:50 -0000	1.10592
--- lisp/ChangeLog	23 Jan 2007 17:56:56 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-01-23  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* files.el (new-files-are-already-modified): New.  This customizable
+ 	variable tells if new files are to be considered as modified.
+ 	(after-find-file): Handle it.
+ 

[-- Attachment #1.1.3: Type: text/plain, Size: 331 bytes --]


-- 
 |      Michaël `Micha' Cadilhac     |  Isn't vi that text editor with        |
 |         Epita/LRDE Promo 2007     |   two modes... One that beeps and      |
 |  http://michael.cadilhac.name     |     one that corrupts your file?       |
 `--JID: michael.cadilhac@gmail.com--'           -- Dan Jacobson         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Creating an empty file
  2007-01-23 16:48     ` David Kastrup
  2007-01-23 17:19       ` Jay Belanger
@ 2007-01-23 18:20       ` Michaël Cadilhac
  1 sibling, 0 replies; 23+ messages in thread
From: Michaël Cadilhac @ 2007-01-23 18:20 UTC (permalink / raw)
  Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1326 bytes --]

David Kastrup <dak@gnu.org> writes:

> Jay Belanger <belanger@truman.edu> writes:
>
>> michael@cadilhac.name (Michaël Cadilhac) writes:
>>
>>> David Kastrup <dak@gnu.org> writes:
>>>
>>>> If I do
>>>> C-x C-f somefile.txt RET C-x C-s
>>>> in order to create and save an empty file, Emacs replies
>>>>
>>>> No changes need to be saved
>>>>
>>>> and does not actually save the file, even though saving the file would
>>>> change the state on disk.
>>>
>>> I can't reproduce it.
>>
>> I can, even with emacs -Q.
>
> I think Michaël assumed that I meant to open an _existing_ file.

Worse, I misread the RET : I did C-x C-f a.txt RET *RET* C-x C-s ;
sorry my bad.

If I have to create an empty file, I do C-x C-f a.txt RET RET
<backspace> then save ; this is why I did that.

The ... unnatural way (but Emacs way) to do it is probably :
C-x C-f a.txt RET C-u M-~ C-x C-s

My opinion is that Emacs is doing TRT. But I may be influenced by some
years of practice :-)

-- 
 |      Michaël `Micha' Cadilhac     |  Un certain Blaise Pascal              |
 |         Epita/LRDE Promo 2007     |    etc... etc...                       |
 |  http://michael.cadilhac.name     |  -- Prévert (Les paris stupides)       |
 `--JID: michael.cadilhac@gmail.com--'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Creating an empty file
  2007-01-23 16:49     ` Leo
  2007-01-23 17:11       ` David Kastrup
@ 2007-01-23 21:57       ` Phil Jackson
  2007-01-24  7:37         ` David Kastrup
  1 sibling, 1 reply; 23+ messages in thread
From: Phil Jackson @ 2007-01-23 21:57 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

Leo <sdl.web@gmail.com> writes:

> I like this behavior. I prevent me from creating empty files.

I like it too but because I don't get pestered with a "modified; kill
anyway?"  when I've mis-typed a filename.

Cheers,
Phil

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

* Re: Creating an empty file
  2007-01-23 17:57         ` Michaël Cadilhac
@ 2007-01-23 23:56           ` David Kastrup
  2007-01-24  1:19             ` Stefan Monnier
  2007-01-24  2:58           ` Giorgos Keramidas
  1 sibling, 1 reply; 23+ messages in thread
From: David Kastrup @ 2007-01-23 23:56 UTC (permalink / raw)
  Cc: belanger, emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:

> Jay Belanger <belanger@truman.edu> writes:
>
>> David Kastrup <dak@gnu.org> writes:
>> ...
>>> This would probably also apply for an existing file that has been
>>> changed on disk, but not in the Emacs buffer.  In this case it might
>>> possibly make sense to ask the "revert buffer" question before saving.
>>> In the case of a non-existing file, there is nothing to revert to,
>>> however.
>>
>> So are you suggesting that when saving a file whose buffer has not
>> been changed, that Emacs should compare it to the disk file anyhow?
>> I had always (always=for the last 10 seconds) thought that it didn't
>> for efficiency reasons.
>
> Well, the modification flag has a certain use that should be
> preserved. What may be done is to add a var
> `new-files-are-already-modified'.
>
> Maybe the (untested) following could help?

I don't think this a good idea since it will also cause Emacs to
refuse deleting the buffer without confirmation, and it will cause
autosaving to occur.

I think the current behavior is perfectly fine with regard to setting
the modification flag (or rather not setting it).  The problem rather
is that C-x C-s consults nothing except the modification flag before
deciding not to save at all, and not asking a question about it.  And
the prefix flag is already used for a different purpose, so we can't
use that to signal "I really mean it".

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Creating an empty file
  2007-01-23 23:56           ` David Kastrup
@ 2007-01-24  1:19             ` Stefan Monnier
  2007-01-24  7:12               ` martin rudalics
  0 siblings, 1 reply; 23+ messages in thread
From: Stefan Monnier @ 2007-01-24  1:19 UTC (permalink / raw)
  Cc: belanger, Michaël Cadilhac, emacs-devel

> I don't think this a good idea since it will also cause Emacs to
> refuse deleting the buffer without confirmation, and it will cause
> autosaving to occur.

Good point.

> I think the current behavior is perfectly fine with regard to setting
> the modification flag (or rather not setting it).  The problem rather
> is that C-x C-s consults nothing except the modification flag before
> deciding not to save at all, and not asking a question about it.  And
> the prefix flag is already used for a different purpose, so we can't
> use that to signal "I really mean it".

So maybe save-buffer should first check to see if the file exists, and if
not, it should save, even if there are no changes.


        Stefan

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

* Re: Creating an empty file
  2007-01-23 17:57         ` Michaël Cadilhac
  2007-01-23 23:56           ` David Kastrup
@ 2007-01-24  2:58           ` Giorgos Keramidas
  2007-01-25  9:06             ` Kevin Rodgers
  1 sibling, 1 reply; 23+ messages in thread
From: Giorgos Keramidas @ 2007-01-24  2:58 UTC (permalink / raw)
  To: Micha?l Cadilhac; +Cc: belanger, emacs-devel

On 2007-01-23 18:57, Micha?l Cadilhac <michael@cadilhac.name> wrote:
>Jay Belanger <belanger@truman.edu> writes:
>>David Kastrup <dak@gnu.org> writes:
>>> This would probably also apply for an existing file that has been
>>> changed on disk, but not in the Emacs buffer.  In this case it might
>>> possibly make sense to ask the "revert buffer" question before saving.
>>> In the case of a non-existing file, there is nothing to revert to,
>>> however.
>>
>> So are you suggesting that when saving a file whose buffer has not
>> been changed, that Emacs should compare it to the disk file anyhow?
>> I had always (always=for the last 10 seconds) thought that it didn't
>> for efficiency reasons.
>
> Well, the modification flag has a certain use that should be
> preserved. What may be done is to add a var
> `new-files-are-already-modified'.

Do we really *need* this?  The `C-x C-s' command will not save empty,
new, unmodified files.  The `C-x C-w' command will happily write empty
files though...

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

* Re: Creating an empty file
  2007-01-24  1:19             ` Stefan Monnier
@ 2007-01-24  7:12               ` martin rudalics
  0 siblings, 0 replies; 23+ messages in thread
From: martin rudalics @ 2007-01-24  7:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

 > So maybe save-buffer should first check to see if the file exists, and if
 > not, it should save, even if there are no changes.

*** files.el.~1.870.~	Sun Dec 24 22:38:56 2006
--- files.el	Wed Jan 24 08:00:24 2007
***************
*** 3541,3547 ****
       ;; In an indirect buffer, save its base buffer instead.
       (if (buffer-base-buffer)
   	(set-buffer (buffer-base-buffer)))
!     (if (buffer-modified-p)
   	(let ((recent-save (recent-auto-save-p))
   	      setmodes)
   	  ;; On VMS, rename file and buffer to get rid of version number.
--- 3541,3548 ----
       ;; In an indirect buffer, save its base buffer instead.
       (if (buffer-base-buffer)
   	(set-buffer (buffer-base-buffer)))
!     (if (or (buffer-modified-p)
! 	    (and buffer-file-name (not (file-exists-p buffer-file-name))))
   	(let ((recent-save (recent-auto-save-p))
   	      setmodes)
   	  ;; On VMS, rename file and buffer to get rid of version number.

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

* Re: Creating an empty file
  2007-01-23 21:57       ` Phil Jackson
@ 2007-01-24  7:37         ` David Kastrup
  0 siblings, 0 replies; 23+ messages in thread
From: David Kastrup @ 2007-01-24  7:37 UTC (permalink / raw)
  To: Phil Jackson; +Cc: Leo, emacs-devel

Phil Jackson <phil@shellarchive.co.uk> writes:

> Leo <sdl.web@gmail.com> writes:
>
>> I like this behavior. I prevent me from creating empty files.
>
> I like it too but because I don't get pestered with a "modified; kill
> anyway?"  when I've mis-typed a filename.

You are confusing the problem with the implementation.  I was not
suggesting setting the "buffer modified" flag.

-- 
David Kastrup

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

* Re: Creating an empty file
  2007-01-24  2:58           ` Giorgos Keramidas
@ 2007-01-25  9:06             ` Kevin Rodgers
  2007-01-25 10:36               ` Romain Francoise
  2007-01-25 22:14               ` Piet van Oostrum
  0 siblings, 2 replies; 23+ messages in thread
From: Kevin Rodgers @ 2007-01-25  9:06 UTC (permalink / raw)
  To: emacs-devel

Giorgos Keramidas wrote:
> On 2007-01-23 18:57, Micha?l Cadilhac <michael@cadilhac.name> wrote:
>> Jay Belanger <belanger@truman.edu> writes:
>>> So are you suggesting that when saving a file whose buffer has not
>>> been changed, that Emacs should compare it to the disk file anyhow?
>>> I had always (always=for the last 10 seconds) thought that it didn't
>>> for efficiency reasons.
>> Well, the modification flag has a certain use that should be
>> preserved. What may be done is to add a var
>> `new-files-are-already-modified'.
> 
> Do we really *need* this?  The `C-x C-s' command will not save empty,
> new, unmodified files.  The `C-x C-w' command will happily write empty
> files though...

`C-x C-w M-p RET', but only immediately after the new file was visited
(otherwise file-name-history may have been updated by an intervening
command).

-- 
Kevin Rodgers
Denver, Colorado, USA

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

* Re: Creating an empty file
  2007-01-25  9:06             ` Kevin Rodgers
@ 2007-01-25 10:36               ` Romain Francoise
  2007-01-25 19:39                 ` Stefan Monnier
  2007-01-25 21:44                 ` Richard Stallman
  2007-01-25 22:14               ` Piet van Oostrum
  1 sibling, 2 replies; 23+ messages in thread
From: Romain Francoise @ 2007-01-25 10:36 UTC (permalink / raw)
  To: emacs-devel

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

> `C-x C-w M-p RET', but only immediately after the new file was
> visited (otherwise file-name-history may have been updated by an
> intervening command).

C-u M-~ C-x C-s?

-- 
Romain Francoise <romain@orebokech.com> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter

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

* Re: Creating an empty file
  2007-01-25 10:36               ` Romain Francoise
@ 2007-01-25 19:39                 ` Stefan Monnier
  2007-01-25 21:44                 ` Richard Stallman
  1 sibling, 0 replies; 23+ messages in thread
From: Stefan Monnier @ 2007-01-25 19:39 UTC (permalink / raw)
  To: emacs-devel

>> `C-x C-w M-p RET', but only immediately after the new file was
>> visited (otherwise file-name-history may have been updated by an
>> intervening command).

> C-u M-~ C-x C-s?

I find M-~ to be a dangerous command.  I've actually disabled it in my
own copy.  So I'd rather not recommend it to anyone.


        Stefan

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

* Re: Creating an empty file
  2007-01-25 10:36               ` Romain Francoise
  2007-01-25 19:39                 ` Stefan Monnier
@ 2007-01-25 21:44                 ` Richard Stallman
  2007-01-25 22:01                   ` martin rudalics
  1 sibling, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-01-25 21:44 UTC (permalink / raw)
  To: Romain Francoise; +Cc: emacs-devel

I generally type  a DEL  in order to make C-x C-s save the empty file.

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

* Re: Creating an empty file
  2007-01-25 21:44                 ` Richard Stallman
@ 2007-01-25 22:01                   ` martin rudalics
  2007-01-25 22:07                     ` Alfred M. Szmidt
  2007-01-26 11:43                     ` Richard Stallman
  0 siblings, 2 replies; 23+ messages in thread
From: martin rudalics @ 2007-01-25 22:01 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> I generally type  a DEL  in order to make C-x C-s save the empty file.

`delete-backward-char' doesn't modify an empty buffer on my Emacs.

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

* Re: Creating an empty file
  2007-01-25 22:01                   ` martin rudalics
@ 2007-01-25 22:07                     ` Alfred M. Szmidt
  2007-01-25 22:14                       ` Lennart Borgman (gmail)
  2007-01-26 11:43                     ` Richard Stallman
  1 sibling, 1 reply; 23+ messages in thread
From: Alfred M. Szmidt @ 2007-01-25 22:07 UTC (permalink / raw)
  To: martin rudalics; +Cc: rms, emacs-devel

   > I generally type  a DEL  in order to make C-x C-s save the empty file.

   `delete-backward-char' doesn't modify an empty buffer on my Emacs.

I think that should be "a DEL" (insert-command followd by
delete-backward-char); I do the same FWIW.

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

* Re: Creating an empty file
  2007-01-25 22:07                     ` Alfred M. Szmidt
@ 2007-01-25 22:14                       ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 23+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-25 22:14 UTC (permalink / raw)
  To: emacs-devel

Alfred M. Szmidt wrote:
>    > I generally type  a DEL  in order to make C-x C-s save the empty file.
> 
>    `delete-backward-char' doesn't modify an empty buffer on my Emacs.
> 
> I think that should be "a DEL" (insert-command followd by
> delete-backward-char); I do the same FWIW.


And I just insert a character and delete it again. Very simple and not 
much to remember ;-)

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

* Re: Creating an empty file
  2007-01-25  9:06             ` Kevin Rodgers
  2007-01-25 10:36               ` Romain Francoise
@ 2007-01-25 22:14               ` Piet van Oostrum
  1 sibling, 0 replies; 23+ messages in thread
From: Piet van Oostrum @ 2007-01-25 22:14 UTC (permalink / raw)
  To: emacs-devel

>>>>> Kevin Rodgers <kevin.d.rodgers@gmail.com> (KR) wrote:

>KR> Giorgos Keramidas wrote:
>>> On 2007-01-23 18:57, Micha?l Cadilhac <michael@cadilhac.name> wrote:
>>>> Jay Belanger <belanger@truman.edu> writes:
>>>>> So are you suggesting that when saving a file whose buffer has not
>>>>> been changed, that Emacs should compare it to the disk file anyhow?
>>>>> I had always (always=for the last 10 seconds) thought that it didn't
>>>>> for efficiency reasons.
>>>> Well, the modification flag has a certain use that should be
>>>> preserved. What may be done is to add a var
>>>> `new-files-are-already-modified'.
>>> 
>>> Do we really *need* this?  The `C-x C-s' command will not save empty,
>>> new, unmodified files.  The `C-x C-w' command will happily write empty
>>> files though...

>KR> `C-x C-w M-p RET', but only immediately after the new file was visited
>KR> (otherwise file-name-history may have been updated by an intervening
>KR> command).

`C-x C-w M-n RET' will not have that problem.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org

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

* Re: Creating an empty file
  2007-01-25 22:01                   ` martin rudalics
  2007-01-25 22:07                     ` Alfred M. Szmidt
@ 2007-01-26 11:43                     ` Richard Stallman
  1 sibling, 0 replies; 23+ messages in thread
From: Richard Stallman @ 2007-01-26 11:43 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

    > I generally type  a DEL  in order to make C-x C-s save the empty file.

    `delete-backward-char' doesn't modify an empty buffer on my Emacs.

that is why you type `a' first.

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

end of thread, other threads:[~2007-01-26 11:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <86bqkphiyj.fsf@lola.quinscape.zz>
     [not found] ` <87odopr8ga.fsf@lrde.org>
2007-01-23 16:35   ` Creating an empty file Jay Belanger
2007-01-23 16:48     ` David Kastrup
2007-01-23 17:19       ` Jay Belanger
2007-01-23 17:23         ` David Kastrup
2007-01-23 17:57         ` Michaël Cadilhac
2007-01-23 23:56           ` David Kastrup
2007-01-24  1:19             ` Stefan Monnier
2007-01-24  7:12               ` martin rudalics
2007-01-24  2:58           ` Giorgos Keramidas
2007-01-25  9:06             ` Kevin Rodgers
2007-01-25 10:36               ` Romain Francoise
2007-01-25 19:39                 ` Stefan Monnier
2007-01-25 21:44                 ` Richard Stallman
2007-01-25 22:01                   ` martin rudalics
2007-01-25 22:07                     ` Alfred M. Szmidt
2007-01-25 22:14                       ` Lennart Borgman (gmail)
2007-01-26 11:43                     ` Richard Stallman
2007-01-25 22:14               ` Piet van Oostrum
2007-01-23 18:20       ` Michaël Cadilhac
2007-01-23 16:49     ` Leo
2007-01-23 17:11       ` David Kastrup
2007-01-23 21:57       ` Phil Jackson
2007-01-24  7:37         ` David Kastrup

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.