all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Cameron Desautels <camdez@gmail.com>
Cc: 19328@debbugs.gnu.org, Ted Zlatanov <tzz@lifelogs.com>
Subject: bug#19328: [PATCH] Add mechanism to prompt about unsaved customizations
Date: Thu, 11 Dec 2014 18:48:48 -0800 (PST)	[thread overview]
Message-ID: <edd8bf6b-203b-47e8-8d39-5232efcd043a@default> (raw)
In-Reply-To: <jwvr3w5abva.fsf-monnier+emacsbugs@gnu.org>

> > What about turning something like this on by default?
> 
> I'm not necessarily opposed to it, but I wonder if it's
> sufficiently unintrusive.
> 
> E.g. if you just want to try out a minor mode like global-auto-
> revert-mode, IIUC this will set the var and mark it as
> "set but unsaved", so when you exit, Emacs will prompt you to
> save this setting.
> 
> Maybe it's actually the right thing to do, but I wonder if it will
> turn out to be more annoying than useful.  And I don't see a good
> solution for it.

FWIW, in the version of this feature that I use:

1. You are not asked to save the changes.  You are asked whether
   you want to see the changed options (in Customize).  If/when
   you see them, you can quit or save any or all of them first.

2. There are some ways to deal with changes that you don't care
   about.  From the `cus-edit+.el' file header:

;;  Dealing with Spurious Changes, 1: Save
;;  --------------------------------------
;;
;;  Even if you don't change any preferences yourself, when
;;  you quit Emacs the first time you are informed that
;;  there are lots of changed preferences, and you are given
;;  a chance to save those changes.  What are those changes?
;;  They represent all of the user preferences that Emacs
;;  and various Emacs libraries have changed behind
;;  Customize's back - even before you did anything.
;;
;;  You'll see user options like `baud-rate' that are set in
;;  Emacs C code without informing Customize to mark their
;;  settings as `standard' (= installed).  There shouldn't
;;  be any such apparent "changes", since this is part of
;;  standard Emacs, but that's the way it is, for now.
;;  Customize is still fairly new, and lots of Emacs
;;  libraries still define and change user preferences
;;  without going through Customize and, in effect, telling
;;  it not to consider such preference changes as changes.
;;
;;  If you choose to save these preference changes, you will
;;  never again be bothered by being informed that they have
;;  changed (unless you change them).  So, that's one
;;  solution to this bother, which makes it a one-time only
;;  nuisance: just say "save all".
;;
;;  Dealing with Spurious Changes, 2: Ignore
;;  ----------------------------------------
;;
;;  Another solution is also possible.  Some user
;;  preferences, like `case-fold-search' and
;;  `debug-on-error' are really the kind of thing that you
;;  change often and temporarily - you don't really care
;;  about saving their changes, and you certainly don't want
;;  to be asked whether or not you want to save them each
;;  time you quit Emacs.
;;
;;  To deal with that, a list of ignored preferences,
;;  `customize-customized-ignore', is defined here.  Its
;;  preferences (symbols) are not used by
;;  `customize-unsaved' at all (you can override that
;;  interactively with a prefix arg).  So, the other way to
;;  deal with the legacy Emacs preferences, besides just
;;  saving them in your custom file, is to add them to
;;  `customize-customized-ignore' so `customize-unsaved'
;;  will ignore them.
;;
;;  To make it easy for you to add preferences to this
;;  ignore list, `Ignore Unsaved Changes' menu items and
;;  buttons have been added.  You can choose to ignore
;;  specific preferences or all preferences in a Customize
;;  buffer - in particular, all preferences in the Customize
;;  buffer from `customize-unsaved' (all changed
;;  preferences).
;;
;;  Dealing with Spurious Changes, 3: Consider Unchanged
;;  ----------------------------------------------------
;;
;;  There is also a third way to treat preference changes
;;  that you are not responsible for, as an alternative to
;;  saving them to your custom file or having Customize
;;  always ignore them: tell Customize to consider the
;;  current changes as unchanged.  This essentially treats
;;  them as having been saved, but without saving them.  You
;;  can do this using the `Consider Unchanged' menu items
;;  and buttons added here.
;;
;;  For instance, after starting Emacs, you can examine the
;;  current preference changes (using `customize-unsaved')
;;  from Emacs itself and loaded libraries, and choose
;;  `Consider Unchanged' to let Customize know that the
;;  current values are to be treated as if they were saved,
;;  but without actually saving them to your custom file.
;;  That way, your custom file is not polluted with things
;;  that you are not really concerned with, yet you are not
;;  bothered by seeing such fictitious changes show up each
;;  time you check for changes.
;;
;;  However, unlike ignoring changes to certain preferences,
;;  and really saving current preference values, `Consider
;;  Unchanged' is not a persistent change.  You can use it
;;  at any time to "reset" the change counter for given
;;  preferences, so that the current change is considered
;;  the new base value (as if it were saved), and any
;;  further changes you make to them will show up as
;;  changes, using `customize-unsaved'.

And note that in my version it is `customize-unsaved'
itself that is modified, so the advantageous behavior is
available also when that command is used interactively.





      parent reply	other threads:[~2014-12-12  2:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 15:46 bug#19328: [PATCH] Add mechanism to prompt about unsaved customizations Cameron Desautels
2014-12-09 15:54 ` Drew Adams
2014-12-09 16:16   ` Cameron Desautels
2014-12-09 16:24     ` Drew Adams
2014-12-09 17:05       ` Cameron Desautels
2014-12-09 17:46         ` Drew Adams
2014-12-09 19:47           ` Cameron Desautels
2014-12-09 20:10             ` Drew Adams
2014-12-10 15:32 ` Ted Zlatanov
2014-12-12  1:04   ` Cameron Desautels
2014-12-12  1:40     ` Stefan Monnier
2014-12-12  1:56       ` Cameron Desautels
2014-12-12  2:36         ` Stefan Monnier
2014-12-12  2:39           ` Cameron Desautels
2014-12-13  1:17             ` Ted Zlatanov
2014-12-13  5:55               ` Stefan Monnier
2014-12-13 13:06                 ` Ted Zlatanov
2014-12-13 23:23                   ` Cameron Desautels
2014-12-14 11:54                   ` Ted Zlatanov
2014-12-14 14:02                     ` Stefan Monnier
2014-12-14 16:31                       ` Ted Zlatanov
2016-02-23 11:36                 ` Lars Ingebrigtsen
2014-12-12  2:48       ` Drew Adams [this message]

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=edd8bf6b-203b-47e8-8d39-5232efcd043a@default \
    --to=drew.adams@oracle.com \
    --cc=19328@debbugs.gnu.org \
    --cc=camdez@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=tzz@lifelogs.com \
    /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.