unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Óscar Fuentes" <ofv@wanadoo.es>, "Andreas Schwab" <schwab@suse.de>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
	23151@debbugs.gnu.org, Richard Stallman <rms@gnu.org>
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)	[thread overview]
Message-ID: <332afe2d-845d-4222-b238-1ab4a154088d@default> (raw)
In-Reply-To: <87bn5w6kk9.fsf@wanadoo.es>

> >> 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.





  parent reply	other threads:[~2016-03-30 16:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 15:36 bug#23151: 25.1.50; Emacs should have a convenient command for saving unchanged buffers Lars Magne Ingebrigtsen
2016-03-29 16:30 ` Drew Adams
     [not found] ` <mailman.8597.1459265831.843.bug-gnu-emacs@gnu.org>
2016-03-29 19:14   ` Alan Mackenzie
2016-03-29 23:07 ` Johan Bockgård
2016-03-29 23:41   ` Drew Adams
2016-03-30 12:09 ` Richard Stallman
2016-03-30 14:19   ` Óscar Fuentes
2016-03-30 15:05     ` Andreas Schwab
2016-03-30 15:40       ` Óscar Fuentes
2016-03-30 16:04         ` Andreas Schwab
2016-03-30 16:28           ` Óscar Fuentes
2016-03-30 17:02             ` Drew Adams
2016-03-30 16:12         ` Drew Adams [this message]
2016-03-31  7:54         ` Richard Stallman
2016-03-31 16:11           ` John Wiegley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=332afe2d-845d-4222-b238-1ab4a154088d@default \
    --to=drew.adams@oracle.com \
    --cc=23151@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=ofv@wanadoo.es \
    --cc=rms@gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).