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

vmd-mode not installed with markdown layer #6385

Closed
jpfairbanks opened this issue Jun 21, 2016 · 12 comments
Closed

vmd-mode not installed with markdown layer #6385

jpfairbanks opened this issue Jun 21, 2016 · 12 comments

Comments

@jpfairbanks
Copy link
Contributor

Description :octocat:

vmd-mode not installed with markdown layer.

Reproduction guide 🪲

  • Start Emacs
  • find a markdown file
  • M-: (vmd-mode)
  • Read error message
  • Check M-x list-packages to see that vmd-mode is "available" not "installed"

Observed behaviour: 👀 💔
You receive this error message:

  Debugger entered--Lisp error: (void-function vmd-mode)
  (vmd-mode)
  eval((vmd-mode) nil)
  eval-expression((vmd-mode) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Expected behaviour: ❤️ 😄
You should see the vmd-mode preview of the markdown file.

System Info 💻

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.105.21
  • Spacemacs branch: develop (rev. 6d5bca7)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(html javascript python helm auto-completion emacs-lisp git github markdown org pandoc mu4e spell-checking syntax-checking csv extra-langs docker xkcd search-engine)

Backtrace 🐾

  Debugger entered--Lisp error: (void-function vmd-mode)
  (vmd-mode)
  eval((vmd-mode) nil)
  eval-expression((vmd-mode) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
@jpfairbanks
Copy link
Contributor Author

This sexp from .emacs.d/layers/+lang/markdown/packages.el is relevant.

(setq markdown-packages
  '(
    company
    company-emoji
    emoji-cheat-sheet-plus
    gh-md
    markdown-mode
    markdown-toc
    mmm-mode
    smartparens
    (vmd-mode :toggle (and (eq 'vmd markdown-live-preview-engine)
                           (executable-find "vmd")))
    ))

@d12frosted
Copy link
Collaborator

Hey,

You should check following things:

  1. That you have set markdown-live-preview-engine to vmd.
  2. That you have installed vmd executable and it's available in your PATH.

Otherwise, vmd-mode is not activated.

@jpfairbanks
Copy link
Contributor Author

I have just corrected those settings and the problem persists.
M-! vmd makes the preview popup. but M-: vmd-mode gives the same error.
(require 'vmd-mode) gives a no such file or directory error.

@d12frosted
Copy link
Collaborator

I can't reproduce. Are you sure that (and (eq 'vmd markdown-live-preview-engine) (executable-find "vmd")) returns t? Try evaluating it under M-:.

Check M-x list-packages to see that vmd-mode is "available" not "installed"

Makes me think that quoted expression return nil for you.

@jpfairbanks
Copy link
Contributor Author

This command: (and (eq 'vmd markdown-live-preview-engine) (executable-find "vmd")) returns "$HOME/.npm-packages/bin/vmd" which is where I have installed my node packages.

  • (eq 'vmd markdown-live-preview-engine) returns t
  • (and (eq 'vmd markdown-live-preview-engine) (executable-find "vmd")) returns a valid path to the vmd executable

Is it possible that the variable is not set until after the markdown layer is activated?
I just restarted emacs and checked the value. By the time init is done, C-h v markdown-live-preview-engine shows:

markdown-live-preview-engine is a variable defined in `config.el'.
Its value is vmd

After investigating this, I ran f e R and emacs installed vmd-mode. It works now. 😅
I will post my debugging notes in order to make it easier for the next person.

@syl20bnr
Copy link
Owner

I reopen for further investigation, it looks like a bug to me.

@syl20bnr syl20bnr reopened this Jun 22, 2016
@TheBB
Copy link
Collaborator

TheBB commented Jun 22, 2016

@jpfairbanks Can I see your dotfile? It sounds like you're setting markdown-live-preview-engine after initialization and not before.

@jpfairbanks
Copy link
Contributor Author

jpfairbanks commented Jun 22, 2016

I am probably using dotspacemacs-configuration-layers incorrectly. A reference to the appropriate section of the manual would be helpful. I had tried to configure the mu4e and shell packages this way and it didn't work, which explains some of the commented out bits.

It starts with:

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.

(defun dotspacemacs/layers ()
  "Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
  (setq-default
   ;; Base distribution to use. This is a layer contained in the directory
   ;; `+distribution'. For now available distributions are `spacemacs-base'
   ;; or `spacemacs'. (default 'spacemacs)
   dotspacemacs-distribution 'spacemacs
   ;; Lazy installation of layers (i.e. layers are installed only when a file
   ;; with a supported type is opened). Possible values are `all', `unused'
   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
   ;; lazy install any layer that support lazy installation even the layers
   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
   ;; installation feature and you have to explicitly list a layer in the
   ;; variable `dotspacemacs-configuration-layers' to install it.
   ;; (default 'unused)
   dotspacemacs-enable-lazy-installation 'unused
   ;; If non-nil then Spacemacs will ask for confirmation before installing
   ;; a layer lazily. (default t)
   dotspacemacs-ask-for-lazy-installation t
   ;; If non-nil layers with lazy install support are lazy installed.
   ;; List of additional paths where to look for configuration layers.
   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
   dotspacemacs-configuration-layer-path '()
   ;; List of configuration layers to load. If it is the symbol `all' instead
   ;; of a list then all discovered layers will be installed.
   dotspacemacs-configuration-layers
   '(
     html
     javascript
     python
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     helm
     auto-completion
     ;; better-defaults
     emacs-lisp
     git
     github
     (markdown :variables markdown-live-preview-engine 'vmd) ;; INTERESTING PART
     org
     pandoc
     mu4e
     ;; '(mu4e :variables
     ;;        mu4e-installation-path "/usr/share/emacs/site-lisp/")
     ;; (shell :variables
     ;;        shell-default-height 30
     ;;        shell-default-position 'bottom)
     spell-checking
     syntax-checking
     ;; version-control
     csv
     extra-langs                        ;includes julia
     docker
     ;; for fun
     xkcd
     search-engine
     )
   ;; List of additional packages that will be installed without being
   ;; wrapped in a layer. If you need some configuration for these
   ;; packages, then consider creating a layer. You can also put the
   ;; configuration in `dotspacemacs/user-config'.
   dotspacemacs-additional-packages '()
   ;; A list of packages that will not be install and loaded.
   dotspacemacs-excluded-packages '(mu4e-maildirs-extension)
   ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
   ;; are declared in a layer which is not a member of
   ;; the list `dotspacemacs-configuration-layers'. (default t)
   dotspacemacs-delete-orphan-packages t))

(defun dotspacemacs/init ()
...

@TheBB
Copy link
Collaborator

TheBB commented Jun 22, 2016

Hm, no, that does look right.

@jpfairbanks
Copy link
Contributor Author

jpfairbanks commented Jun 24, 2016

In case anyone is thinking about this. I get a log message on startup but

--------------------------
Found 1 orphan package(s) to delete...
--> deleting vmd-mode... [1/1]

262 packages loaded in 3.323s (e:209 r:1 l:13 b:39)
-------------------------

In the messages buffer.

Loading /home/james/.emacs.d/layers/+distributions/spacemacs-base/keybindings.el (source)...done
(Spacemacs) --> deleting vmd-mode... [1/1]
Package `vmd-mode-20160531.1719' deleted.
Loading /home/james/.emacs.d/.cache/spacemacs-buffer.el (source)...done

vmd mode still works though.

@d12frosted
Copy link
Collaborator

Does it still happen, @jpfairbanks ? :)

@d12frosted
Copy link
Collaborator

Closing for inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants