initsplit icon indicating copy to clipboard operation
initsplit copied to clipboard

Prone to clobbering customization edits

Open dabrahams opened this issue 13 years ago • 6 comments

If I make edits to a customization stanza and then save customizations through the UI, the edits will get clobbered. Maybe the thing to do is store an md5 of the stansas to see whether they've been changed.

dabrahams avatar Aug 28 '11 19:08 dabrahams

dabrahams [email protected] writes:

If I make edits to a customization stanza and then save customizations through the UI, the edits will get clobbered. Maybe the thing to do is store an md5 of the stansas to see whether they've been changed.

Don't edit customization stanzas directly.

John

jwiegley avatar Aug 29 '11 01:08 jwiegley

on Sun Aug 28 2011, jwiegley <reply+i-1504799-f0d923c147c3b638d4b5c5c734a6ba9973b2b63e-AT-reply.github.com> wrote:

Don't edit customization stanzas directly.

Easy for you to say, but; it happens when grabbing changes from other people, for example. I also want initsplit to be bulletproof. I created this ticket for myself; you don't need to concern yourself with it.

dabrahams avatar Aug 29 '11 01:08 dabrahams

dabrahams [email protected] writes:

Easy for you to say, but; it happens when grabbing changes from other people, for example. I also want initsplit to be bulletproof. I created this ticket for myself; you don't need to concern yourself with it.

OK. When I have to muck with changes in this way, I always immediately restart Emacs.

Anyway, I've moved all my customizations to a single file again, settings.el, since it's not code I manage by hand. So I'll leave you to it.

John

jwiegley avatar Aug 29 '11 01:08 jwiegley

Thinking more on this feature, until it is more fully proven I'd prefer it be made (1) optional, and (2) off by default. Also, I would prefer the MD5 data be kept in an ancillary file, and not embedded within the user's dot files.

Thinking even further, I thought of this: What if you create an after-save-hook function that simply re-evaluation the custom-set-variables form? I think this solves every case except two:

a. You delete the customization manually in .emacs; it won't be unset until you restart (this affect the MD5 solution as well)

b. You have Set but not Saved a customization variable, and THEN you edit the .emacs and save it, causing it to clobber the Set variable.

John

jwiegley avatar Aug 29 '11 15:08 jwiegley

on Mon Aug 29 2011, jwiegley <reply+i-1504799-f0d923c147c3b638d4b5c5c734a6ba9973b2b63e-AT-reply.github.com> wrote:

Thinking more on this feature, until it is more fully proven I'd prefer it be made (1) optional, and (2) off by default. Also, I would prefer the MD5 data be kept in an ancillary file, and not embedded within the user's dot files.

MD5 was just one idea. Do you want maintainership of initsplit back?

Thinking even further, I thought of this: What if you create an after-save-hook function that simply re-evaluation the custom-set-variables form? I think this solves every case except two:

a. You delete the customization manually in .emacs; it won't be unset until you restart (this affect the MD5 solution as well)

b. You have Set but not Saved a customization variable, and THEN you edit the .emacs and save it, causing it to clobber the Set variable.

I don't like any of these scenarios much. I was rather thinking that when we delete the stanza we could re-read it but eval it slightly differently (e.g. into different properties of each symbol) and compare that to what customize thinks the saved values are. That should be able to be bulletproof without involving any new MD5s.

Dave Abrahams BoostPro Computing http://www.boostpro.com

dabrahams avatar Aug 29 '11 21:08 dabrahams

dabrahams [email protected] writes:

I don't like any of these scenarios much. I was rather thinking that when we delete the stanza we could re-read it but eval it slightly differently (e.g. into different properties of each symbol) and compare that to what customize thinks the saved values are. That should be able to be bulletproof without involving any new MD5s.

That sounds pretty good to me!

John

jwiegley avatar Aug 29 '11 21:08 jwiegley