Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move autogenerated package list out of .spacemacs #5751

Closed
necto opened this issue Apr 11, 2016 · 8 comments
Closed

Move autogenerated package list out of .spacemacs #5751

necto opened this issue Apr 11, 2016 · 8 comments

Comments

@necto
Copy link

necto commented Apr 11, 2016

Hello,
I keep my .spacemacs under VCS, and it is annoying that each time when I change anything, or the Spacemacs gets updated, it regenerates the package plain list:

 '(package-selected-packages
   (quote
    (powerline spinner s parent-mode projectile pkg-info epl request flx magit-popup git-commit with-editor smartparens iedit highlight pos-tip yasnippet packed dash avy helm-core async auto-complete utop ocp-indent merlin tuareg caml magit color-theme-sanityinc-solarized marmalade material-theme bracketed-paste anzu helm xterm-color shell-pop multi-term eshell-prompt-extras esh-help smeargle orgit mmm-mode markdown-toc markdown-mode magit-gitflow helm-gitignore helm-company helm-c-yasnippet gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-gutter-fringe+ git-gutter-fringe git-gutter+ git-gutter gh-md evil-magit diff-hl company-statistics company-quickhelp company auto-yasnippet ac-ispell zenburn-theme monokai-theme solarized-theme ws-butler window-numbering volatile-highlights vi-tilde-fringe spaceline smooth-scrolling restart-emacs rainbow-delimiters popwin popup persp-mode pcre2el paradox page-break-lines open-junk-file neotree move-text macrostep lorem-ipsum linum-relative leuven-theme info+ indent-guide ido-vertical-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation help-fns+ helm-themes helm-swoop helm-projectile helm-mode-manager helm-make helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido fill-column-indicator fancy-battery expand-region exec-path-from-shell evil-visualstar evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-indent-plus evil-iedit-state evil-exchange evil-escape evil-args evil-anzu eval-sexp-fu elisp-slime-nav define-word clean-aindent-mode buffer-move auto-highlight-symbol auto-compile aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line quelpa package-build use-package which-key bind-key bind-map evil spacemacs-theme)))

As it disturbs my flow and leads to meaningless changes in my configuration commits.
I propose to move it into some transient file in .emacs.d

@necto necto changed the title Move autogenerated package list from .spacemacs Move autogenerated package list out from .spacemacs Apr 11, 2016
@necto necto changed the title Move autogenerated package list out from .spacemacs Move autogenerated package list out of .spacemacs Apr 11, 2016
@StreakyCobra
Copy link
Contributor

For the record: This variable is new in emacs 25 and there is a presentation of it here: http://endlessparentheses.com/new-in-package-el-in-emacs-25-1-user-selected-packages.html

Emacs 25 is not officially supported yet, but this has to be discussed for the future. We can either ignore and disable this variable, or we may benefit from it for dotspacemacs-additional-packages in some way maybe?

@punassuming
Copy link
Contributor

This would be a non issue if the custom settings would be saved to another file, any chance we can set up an external custom.el?

@bmag
Copy link
Collaborator

bmag commented Apr 27, 2016

Sure, it's a simple matter using the variable custom-file. Here's an example from the manual:

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

See also the built-in documentation for custom-file.

However, it would still produce meaningless commits for users who use the Customize interface for setting config options.

@bmag
Copy link
Collaborator

bmag commented Apr 27, 2016

If we choose to ignore this variable, we can prevent it from being saved by advising package-install. package-install takes an optional dont-select argument, that prevents a package-selected-packages from being updated. If we use an advice to always pass the dont-select argument, it should prevent package-selected-packages from being generated.
Likewise, package-delete takes an optional nosave argument with the same meaning, so we need an advice for that too.

There are some caveats:

  • it doesn't take care of packages installed via package-installed-from-buffer (is this how quelpa installs packages?)
  • using advice is sometimes harder to maintain (with a short search, I couldn't find a better way)

@StreakyCobra
Copy link
Contributor

I'm in favor of changing custom-file to .emacs.d/.cache/… with a FAQ entry explaining how to revert this behavior. These customizations are most of the time not made on purpose (in my case), are creating conflicts with dotspacemacs/user-* configurations without noticing sometime, and their behavior is not clearly defined as they are executed out of Spacemacs loading process.

@bixuanzju
Copy link
Contributor

After the new custom setting, how can I move autogenerated package list?

@d12frosted
Copy link
Collaborator

@bixuanzju I don't use custom system at all, so I just set the value of spacemacs--custom-file to "" (empty string, not nil!). I am not sure though about implications of this setting for custom system users.

But it would be better to allow people to override file containing that function 😸 I'll look into it.

@d12frosted
Copy link
Collaborator

This issue is irrelevant anymore (and originally it had a well working solution). New issue for getting rid of custom settings from dotspacemacs file is #7891.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Mailing list
  
Pending merge
Development

No branches or pull requests

7 participants