I open file ~/.srecode/html.srt, same if you open file like
/usr/share/emacs/24.2/etc/srecode/java.srt but you been clean up
srecode-current-map by:
(setq srecode-current-map (srecode-map "SRecode Map"))
and then open file with js-mode and execute M-x srecode-minor-mode.
I got error:
There should be a mode declaration in ...
Debugging shown that:
(defun srecode-map-validate-file-for-mode (file fast)
have code:
(if buff-orig
(set-buffer buff-orig)
(set-buffer (get-buffer-create " *srecode-map-tmp*"))
(insert-file-contents file nil nil nil t)
;; Force it to be ready to parse.
(srecode-template-mode)
(let ((semantic-init-hook nil))
(semantic-new-buffer-fcn))
)
(semantic-fetch-tags)
....
(let* ((mode-tag
(semantic-find-first-tag-by-name "mode" (current-buffer)))
(semantic-fetch-tags) is nil for already opened .srt files because in that
case (semantic-new-buffer-fcn) wasn't called...
So semantic-find-first-tag-by-name fine nothing and this if evaluated to nil:
(if mode-tag
(setq val (car (semantic-tag-variable-default mode-tag)))
(error "There should be a mode declaration in %s" file))
(semantic-new-buffer-fcn) need somehow call in case if user open .srt file and
doesn't enable semantic in this buffer...
Nobody/Anonymous
srecode
None
Public
|
Date: 2013-01-14 19:24:32 PST Force semantic-new-buffer-fcn to run while calculating the srecode template |