unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: rms@gnu.org
Cc: 38696@debbugs.gnu.org, arthur.miller@live.com, jidanni@jidanni.org
Subject: bug#38696: "If you edit it by hand, you could mess it up"
Date: Tue, 24 Dec 2019 08:08:11 -0800 (PST)	[thread overview]
Message-ID: <71ad22c1-0af2-4428-8d64-22e21f4b2a7b@default> (raw)
In-Reply-To: <E1ijbZr-0000XT-GX@fencepost.gnu.org>

>   > But that's not the likeliest scenario.  The real,
>   > more likely problem is that you make a change to
>   > this code and later Customize overwrites your
>   > change - and you might not be aware of that.
> 
> We could make Customize detect hand-editing by looking at the value
> in .emacs and determining that it doesn't have a format Customize
> could ever write?
> 
> Or we could the comment say, "If you want to edit this value by hand,
> delete this comment."  Customize could interpret the absence of
> that comment as meaning the value has been hand-edited.
> 
> Either way, Customize could then report a problem and offer a choice
> of (1) deleting the value in the file, or (2) quitting.

I guess you're proposing that, if a user edits
what Customize puts in a user file (`custom-file'
or init file), then Customize could/should try to
detect that that has occurred.  And then Customize
could/should ask the user how to handle that
situation.

A priori that sounds complicated, and maybe error
prone, to me.  But maybe it's worth considering.

My suggestion would be to just change the comment
wording a bit, to make clear that future use of
Customize might overwrite any manual changes you
make to that code.  IOW, state that clearly as a
major reason _why_ you're advised not to edit the
code.

And as others have pointed out, future Customize
use might not always be obvious, interactive use
of `M-x customize-*' commands.

---

I'd also suggest that the inserted comment, and
the Emacs docs more generally, would do well to
suggest/advise that users use `custom-file', to
keep Customize-generated code separate from their
init files.

That's a good idea in general, IMO, and it would
go a long way toward avoiding the problem of
users editing such code, i.e., of users and
Customize stomping on each other.

---

I'd even suggest that if `custom-file' is
undefined then Customize should immediately ask
a user to define it, instead of just silently
writing to a user's init file.

At least, that could be done if Customize could
be sure there's not already any Customize code
in the init file.

But if an init file already has some Customize
code, then such a dialog becomes more delicate.
Customize might need to just advise moving such
existing code to the new `custom-file'.

Or if, as you suggest, it could detect its own
code then it could offer to move any such that's
in the init file to a `custom-file'.





  reply	other threads:[~2019-12-24 16:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21  0:02 bug#38696: "If you edit it by hand, you could mess it up" 積丹尼 Dan Jacobson
2019-12-21  6:34 ` Phil Sainty
2019-12-21  8:12   ` 積丹尼 Dan Jacobson
2019-12-21 19:08 ` Richard Stallman
2019-12-22  0:35   ` 積丹尼 Dan Jacobson
2019-12-22 17:04     ` Eli Zaretskii
2019-12-23  2:58     ` Richard Stallman
2019-12-23  3:29       ` 積丹尼 Dan Jacobson
2019-12-22  3:35 ` arthur miller
2019-12-22 17:49   ` Drew Adams
2019-12-23  0:36     ` 積丹尼 Dan Jacobson
2019-12-24  4:13     ` Richard Stallman
2019-12-24 16:08       ` Drew Adams [this message]
2019-12-25  2:37         ` Richard Stallman
2019-12-26  1:03           ` 積丹尼 Dan Jacobson
2020-08-06 10:16 ` Lars Ingebrigtsen

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=71ad22c1-0af2-4428-8d64-22e21f4b2a7b@default \
    --to=drew.adams@oracle.com \
    --cc=38696@debbugs.gnu.org \
    --cc=arthur.miller@live.com \
    --cc=jidanni@jidanni.org \
    --cc=rms@gnu.org \
    /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).