1

Background I store Emacs my configuration in a .emacs and separate custom file. I would like to store both in a public repository like Github. I also use filesets which saves filenames & file paths in one of these files. Data associated with the variable filesets-data gets placed in my custom file because I set the variable custom-file in my .emacs like this:

(setq custom-file "~/.emacs-custom-work.el") 

I use Emacs at work and I don't want to put private data (filenames & paths) in public repositories.

Question Detail I need a way to store data associated with filesets (Emacs uses the variable filesets-data) in a file separate from my custom file (also not in other standard Emacs init files). I will not place this separate file (which would be a dedicated place to store filesets-data) in a public repository.

Not looking for alternatives to the functionality provided by the filesets package at this time.

Currently running Emacs 24.4 on Ubuntu 14.4 at work.

The Emacs manual and the emacswiki site are usually helpful but not with this.

Drew
  • 75,699
  • 9
  • 109
  • 225
Mikef
  • 153
  • 6
  • This is a great question. What I describe in my answer is essentially a workaround. I suggest that you request an Emacs enhancement, here, using `M-x report-emacs-bug` (enhancements are reported this way). For example, `filesets.el` could have an additional option, which is the file in which to save `filesets-data` (and not save it in `custom-file`/init-file). The default value of that file-name option could be the value of `custom-file` or init-file, but at least users would have a way to opt out of that behavior. – Drew Jun 28 '17 at 17:27
  • Worked. I was already using savehist so I modified savehist-additional-variables, removed the customization, got out and back in emacs. Filesets are there, and not in my custom file. One interesting thing (seems like a small bug) is that M-x filesets-save messaged "Wrote ..my_custom_file.el" Checked the file and it did not write it. – Mikef Jun 28 '17 at 18:15
  • Please consider a bug report (enhancement request and perhaps `filesets-save` message correction). – Drew Jun 28 '17 at 20:54

1 Answers1

0
  1. You can use library savehist.el and add filesets-data to the value of option savehist-additional-variables. Then customize option savehist-file to point to a file you choose. That takes care of saving the value somewhere other than custom-file.

  2. But you also need to prevent Customize from saving it to your custom-file. For that:

    a. First, remove it from your custom-file contents

    b. Do not use Customize to save filesets-data. You can use Customize to change the value, but do not use it to save the changes. Let savehist save the changed value.

Drew
  • 75,699
  • 9
  • 109
  • 225