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

vue-mode using mmm-mode has some issue with persp-mode #118

Open
jjpark78 opened this issue Jul 21, 2020 · 3 comments
Open

vue-mode using mmm-mode has some issue with persp-mode #118

jjpark78 opened this issue Jul 21, 2020 · 3 comments

Comments

@jjpark78
Copy link

vue-mode.el use mmm-mode
and it change sub-mode to major-mode

ex) if i edit XXXX.vue file with vue-mode
when cursor is inside of template region, major-mode changes to pug, jade, html or something else
when cursor is inside of script region, major mode change to javascript for typescript
when cursor is inside of style region, major mode changes to css, scss, sylus..

i thinks this is how mmm-mode is works.

the problem is when i store sessions with persp-mode
buffer treated as a sub-mode (like typescript, javascript, pug, css) not a just "vue-mode"

ex)

    (def-buffer "SearchInfoRow.vue" "/Users/jjpark78/Development/JJSOFT/donna/DONNA-WEB/src/components/search/SearchInfoRow.vue" typescript-mode)

cause of cursor is inside of typescript section when save session SearchInfoRow.vue buffer, it stored as a "typescript-mode" not a "vue-mode"

i know persp-mode custom function can handle this problem .
but i dont know how. i have a zero exprience with emacs lisp.

@Bad-ptr
Copy link
Owner

Bad-ptr commented Sep 20, 2020

Something like this:

    (persp-def-buffer-save/load
     :minor-mode 'vue-mode :tag-symbol 'def-vue-buffer
     :save-vars '(major-mode default-directory)
     :after-load-function #'(lambda (b &rest _)
                                (with-current-buffer b (vue-mode 1))))

@Bad-ptr
Copy link
Owner

Bad-ptr commented Sep 20, 2020

Or

    (persp-def-buffer-save/load
     :minor-mode 'vue-mode :tag-symbol 'def-vue-buffer
     :save-vars '(major-mode default-directory)
     :mode-restore-function #'(lambda (_mode) (vue-mode)))

@jjpark78
Copy link
Author

Or

    (persp-def-buffer-save/load
     :minor-mode 'vue-mode :tag-symbol 'def-vue-buffer
     :save-vars '(major-mode default-directory)
     :mode-restore-function #'(lambda (_mode) (vue-mode)))

thanks.
but i moved to web-mode.
but i will try it

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

No branches or pull requests

2 participants