bookest / arduino-mode

Emacs major mode for editing Arduino sketches.
102 stars 42 forks source link

Emacs freezes after typing `#include "' #5

Open guicho271828 opened 11 years ago

guicho271828 commented 11 years ago

I started using this mode but it seems something is not working right. The problem occurs after I typed in the first double-quote in the same line as #include. something is runnung a infinite loop but no idea. (searching the library path?) I've tested with Abbrev, gtags and doxymacs turned off but the same things happen.

Ubuntu 12.04LTS, emacs 23.3.1 grabbed the latest arduino-mode from github, related code snipplets in emacs:


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; doxymacs

(lazyload 'doxymacs-mode "doxymacs")
(lazyload 'gtags-mode "gtags")
(add-hook 'c-mode-common-hook
          '(lambda()
             (gtags-mode 1)
             (gtags-make-complete-list)))

(add-hook 'c-mode-common-hook 'doxymacs-mode)
(add-hook 'c++-mode-hook 'doxymacs-mode)

(defun bind-m-ret-to-comment-line ()
  (define-key c-mode-map (kbd "<M-return>") 'c-indent-new-comment-line))
(add-hook 'c-mode-hook 'bind-m-ret-to-comment-line)
(add-hook 'c++-mode-hook 'bind-m-ret-to-comment-line)
(defun my-doxymacs-font-lock-hook ()
    (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
        (doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Arduino mode

(add-to-list 'load-path (site "arduino-mode/"))
(add-to-list 'auto-mode-alist
         '("\\.\\(pde\\|ino\\)$" . arduino-mode))
(lazyload 'arduino-mode "arduino-mode")
guicho271828 commented 11 years ago

Putting a #include ""' in .cpp and renaming the file with extention .ino is ok. However if I add another"' it freezes again.

guicho271828 commented 11 years ago

include <> is ok.

roastercode commented 9 years ago

I have the same trouble with #define the trouble is the # itself

roastercode commented 9 years ago

you can use C-g to un-freeze and edit your file.