-1

I'm writing a package where I need to store some data and restore it in the next session. I don't want to create a file for it so my idea is to save it with customize-save-variable. This works great but it shouldn't show up in the customize-inteface.

Is there a way to hide entries? If not can I make them unmodifiable?

  • So, you are trying to use customization interface to store your data which is not customization info by its nature (otherwise you wouldn't have this problem of hiding things). To abstract the situation you're trying to use system A for what system B should do only because A is similar to B in one aspect and you don't want to write/find system B. Please don't do this sort of thing in programming. If you want persistence, you'll end up using file anyway: file created by customize or by your own code. From the two, the second is better in your case. – Mark Karpov Oct 1 '15 at 12:35
  • @Mark The package is for personal use only. I doesn't really matter if that's generally what a programmer should do. I know I would abuse it's purpose, but I would be ok with that. I just don't want to create an extra file for two small pieces of information. The custom file exists anyway (in my setup I have configured it to store custom info in a separate file) and customize-save-variable is convenient. I don't see this as problematic as you. – clemera Oct 1 '15 at 15:49
  • @hatschipuh it's problematic because you're running into limitations of customize right here; it wasn't designed to support invisible read-only customizations. Read-only configuration? That makes no sense! Instead, you really should write to a file. It's not as hard as it looks, because Lisp, and eval, you know. – PythonNut Oct 4 '15 at 3:23
  • @PythonNut I have to admit I just was to lazy to figure out how to do this the other way. I will close the question because I realize that it is really not the appropriate way to save session information. – clemera Oct 4 '15 at 10:09
2

It is not the right way to do this. As stated in the comments customize is for customizing so it isn't a good idea to abuse it to store session information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.