code-iai / ros_emacs_utils

Emacs tools for ROS
17 stars 19 forks source link

snippet is overwrite #23

Closed benbenji closed 4 years ago

benbenji commented 7 years ago

Hi ! I tried rosemacs,but I found the snippet mode only left c++mode,and snippets only left the things about ros,so I deleted the config of yasnippet in rosemacs-config.el like this: ;;; Default modes list. Mostly there to make sure Yasnippets work. ;;; Will overwrite the settings from your emacs init file, so be careful... ;; (setq auto-mode-alist ;; (append '(("\.C$" . c++-mode) ;; ("\.cc$" . c++-mode) ;; ("\.c$" . c-mode) ;; ("\.h$" . c++-mode) ;; ("makefile$" . makefile-mode) ;; ("Makefile$" . makefile-mode) ;; ("\.asd" . lisp-mode) ;; ("\.launch" . xml-mode)) auto-mode-alist))

;; ;;; Yasnippets: templates for standard structures. E.g. wgh TAB in a *.h file. ;; (require 'yasnippet) ;; (add-to-list 'yas-snippet-dirs "/home/yuebenben/catkin_ws/install/share/emacs/site-lisp/snippets") ;; (yas-global-mode 1) but it is still worng I found even I just added "(add-to-list 'load-path "~/catkin_ws/install/share/emacs/site-lisp")",this problem occured! and the message buffer show:

[yas] Reloaded everything (snippets will load just-in-time).... [yas] Loading for `c++-mode', just-in-time: (lambda nil (yas--load-directory-1 (quote /home/yuebenben/catkin_ws/install/share/emacs/site-lisp/snippets/c++-mode) (quote c++-mode)))! [yas] Loading compiled snippets from /home/yuebenben/catkin_ws/install/share/emacs/site-lisp/snippets/c++-mode why it is occur? Can you help me ? Thank you!

Seanmatthews commented 5 years ago

In general, I think including yasnippet.el file in this repo is causing problems. With newer emacs (26.x) and ubuntu 16, I received errors when opening c++ files. To resolve it, I install yasnippet with use-package and remove the yasnippet.el file.

gaya- commented 5 years ago

Good point, I'll see if I can just leave the ROS snippets without including the library.

gaya- commented 4 years ago

Added a guard to see if yasnippet library is installed or not. Solved in 3e68557.