yasnippet-snippets icon indicating copy to clipboard operation
yasnippet-snippets copied to clipboard

Suggestion: use custom-set-variable

Open Vonfry opened this issue 6 years ago • 2 comments
trafficstars

For someone, custom file may be loaded at last of all init code. The changing by yasnippet-snippets-initialize will be overwritten unless one edit custom file or load this package by after-init-hook.

Vonfry avatar Dec 02 '18 06:12 Vonfry

Thanks for the suggestion @Vonfry . I didn't quite understand what you mean though, so the problem is that since yasnippet-snippets is loaded after yasnippet and before you call snippets-initialize, yasnippet is not picking up all the snippets correctly?

I actually haven't used yasnippet-snippets-initialize for a long time, they are just lazily loaded anyway. Removing that would not solve your problem?

AndreaCrotti avatar Jan 14 '19 16:01 AndreaCrotti

Example:

(require 'yasnippet)
;; yas-snippet-dirs has a default value

(custom-set-variables '(yas-snippet-dirs some-list))
;; This will be saved in custom-file

(require 'yasnippet-snippets)
;; yasnippet-snippetsinitialize will overwrite yas-snippet-dirs, but not saving in custom-file

(load custom-file)
;; dirs edited by yasnippet-snippetsinitialize is lost.

One way to solve is calling (custom-save-all) before loading custom-file.

Vonfry avatar Jan 14 '19 16:01 Vonfry