all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Cc: 'Stefan Monnier' <monnier@iro.umontreal.ca>
Subject: C-x C-q and undo [was: Bind `q' to `quit-window' or similar in *Messages*]
Date: Thu, 4 Feb 2010 08:58:00 -0800	[thread overview]
Message-ID: <0122CC6B2F0146488E31D2B40610507E@us.oracle.com> (raw)
In-Reply-To: <jwvljf9rpb9.fsf-monnier+emacs@gnu.org>

> I've often felt that C-x C-q should turn on the undo-log when
> making a buffer writeable.  It hasn't bothered me enough to actually
> code it up and try it, but maybe people could try it out and see if it
> leads to problems.

I was wondering the same thing.
But maybe the two should not always be coupled.

It's easy enough to enable undo, with command `buffer-enable-undo'. Of course,
that's not bound to a key, by default. (Likewise, disabling.)

The prefix arg for `C-x C-q' is used only to specify on or off explicitly. One
possibility would be to have plain `C-u' toggle read-only and call
`buffer-enable-undo' or `buffer-disable-undo' as appropriate. So:

C-1 C-x C-q would turn read-only ON (and not affect undo)
C-  C-x C-q would turn read-only OFF   "   "   "   "
C-u C-x C-q would toggle read-only and turn undo on/off accordingly

Even more flexible: We could have an option, `toggle-read-only-affects-undo'. If
non-nil, then `C-x C-q' without `C-u' would affect undo; with `C-u' it would not
affect undo. If nil, the behavior would be reversed: without `C-u' would not
affect undo; with `C-u' it would affect undo.





  reply	other threads:[~2010-02-04 16:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04  3:24 Bind `q' to `quit-window' or similar in *Messages* Roland Winkler
2010-02-04  4:27 ` Miles Bader
2010-02-04  8:15   ` Tassilo Horn
2010-02-04  8:24     ` Tassilo Horn
2010-02-04 15:33   ` Stefan Monnier
2010-02-04 16:58     ` Drew Adams [this message]
2010-02-04 23:40     ` Miles Bader

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

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

  git send-email \
    --in-reply-to=0122CC6B2F0146488E31D2B40610507E@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 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.