Skip to content

Conversation

@benzwick
Copy link
Contributor

@benzwick benzwick commented Sep 8, 2019

Otherwise the command normal-top-level-add-subdirs-to-load-path
cannot be used to add yasnippet-snippets to the load-path.
This way, the package yasnippet-snippets is made available
but the actual snippets are not loaded as lisp code
(which would cause an error).

See also: 45a652e ("Create .nosearch", 2014-10-04)

Otherwise the command normal-top-level-add-subdirs-to-load-path
cannot be used to add yasnippet-snippets to the load-path.
This way, the package yasnippet-snippets is made available
but the actual snippets are not loaded as lisp code
(which would cause an error).

See also: 45a652e ("Create .nosearch", 2014-10-04)
@AndreaCrotti
Copy link
Owner

Thanks @benzwick , but I don't quite understand why you need to use that command to add these snippets?
You don't use yas-snippet-dirs to add more snippets directories?
Or I misunderstood something?

@AndreaCrotti AndreaCrotti added the seen PR was seen and initial feedback was given label Sep 24, 2019
@benzwick
Copy link
Contributor Author

I added yasnippet-snippets as a git submodule and load it like this:

;; Add Git submodules to load path
(let ((default-directory
	(concat user-emacs-directory (convert-standard-filename "submodules/"))))
  (normal-top-level-add-subdirs-to-load-path))

(require 'yasnippet)
(require 'yasnippet-snippets)

(add-hook 'prog-mode-hook #'yas-minor-mode)

If .nosearch is in the top level directory (as it is now) the yasnippet-snippets package cannot be loaded using the commands normal-top-level-add-subdirs-to-load-path and (require 'yasnippet-snippets) because Emacs does not search the yasnippet-snippets subdirectory. Without .nosearch Emacs tries to load the snippets which causes an error. Moving .nosearch to the snippets subdirectory solves the problem by allowing Emacs to search the top level yasnippet-snippets directory (to find yasnippet-snippets.el) but not the snippets subdirectory.

@AndreaCrotti
Copy link
Owner

Ah I see, I haven't used git submodules for Emacs packages in a long time I forgot about it.

Anyway makes sense I can merge it, thanks

@AndreaCrotti AndreaCrotti merged commit 221f2c3 into AndreaCrotti:master Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

seen PR was seen and initial feedback was given

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants