bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23151: 25.1.50; Emacs should have a convenient command for saving un


From: Drew Adams
Subject: bug#23151: 25.1.50; Emacs should have a convenient command for saving unchanged buffers
Date: Wed, 30 Mar 2016 09:12:19 -0700 (PDT)

> >> a safe method of forcing Emacs to save the file without altering the
> >> buffer's content.
> >
> > Two methods were already presented in this thread.
> 
> Someone mentioned C-u C-x C-w, which shows a prompt where you are
> supposed to write the file name of the buffer you are visiting. If you
> type the wrong file name, hopefully you will notice the mistake before
> creating too much damage.

I mentioned it.  And no - just hit RET.  End of story.

You need not enter any file name.  The file you are visiting is
saved (rewritten), without any name change.  There is really
nothing error prone about this, AFAICS.

> This is not a safe method.

Seems safe enough to me.  Have you encountered danger when using
it?  (Have you even tried to use it?)

But you are welcome to define a command that does the same thing
without any need to hit RET.  And bind that to a key.  Trivial to do.

I see no special reason why we need to add such a command to Emacs,
and a fortiori why we should need to bind such a command to a key
by default, and super a fortiori why we should modify `C-x C-s' so
that it does this.  Let's please keep someone's clever idea of DWIM
away from our good old stalwart `C-x C-s'.

This all seems to be a tempest in a teapot.
YAGNI, or if YNI then you can easily write it.

> Other mentioned C-u M-~ (which actually should be C-u M-~ C-x C-s).
> Apart from being a long finger-twisting sequence, M-~ is impossible to
> type on some keyboards where ~ is written as AltGr-~, or difficult in
> some input methods, where ~ is a dead key.
> 
> This is not convenient.

Again, trivial to bind to any key you like.

> The char&del C-x C-s method is popular because Emacs does
> not offer something better out of the box.

Again with the "popular" claim?  3 people said they use it,
sometimes.  Hardly a groundswell.

And neither method mentioned is a difficult workaround, if
you really want to force rewriting of the visited file.

> It is about time that Emacs provides an intuitive (as per
> Emacs standards), convenient and safe method for doing that task.

"That task" - again hyperbole.  Not much of a task, IMHO.

So no, I disagree that it is "about time that Emacs provide"
something to fill this great lack.

Nothing wrong with adding a command, if others really feel
it is lacking.  But I don't see why we would bind it by
default, and even less why we should mess with `C-x C-s'
to handle this "need".

Here's another thing to ponder: Of the 3 people who expressed
a need for force-saving the current file, how many bothered
to trivially define and bind a command to do that?  None of
them should have any problem doing that - they all Lisp well.

None did it (AFAIK).  Why not?  Because it isn't needed.
Even by them.  If enough users define and bind such a key,
we'll hear about it and we can then reconsider.  Until then,
WAGNI.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]