help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to enable the Major mode: ttcn-3-mode.


From: Hill
Subject: Re: How to enable the Major mode: ttcn-3-mode.
Date: Wed, 08 Dec 2010 15:23:49 -0000
User-agent: G2/1.0

On 8月8日, 下午9时38分, "Colin S. Miller" <no-spam-
thank-...@csmiller.demon.co.uk> wrote:
> Hill,
> <snip!>
>
> > Thanks Colin S. Miler very much!
>
> Just "Colin" will do ;-}
>
> > I have turn on the font-lock at the beginning of the .emacs:
>
> > (global-font-lock-mode t)
>
> Ok, that should turn font locking for all (major) modes
> with a syntax table.
>
> > I try it again, after comment the line:
> > ;;(setq auto-mode-alist (cons '("\\.ttcn3?" . ttcn-3-mode) auto-mode-
> > alist))
>
> With the semi-colons? ';' is called a semicolon.
> Everything after a semicolon to the end of the line is a comment.
> Emacs will ignore the comments.
>
> I'd use
> (add-to-list 'auto-mode-alist '("\\.ttcn3?" . ttcn-3-mode) 't)
> to add to the list of modes. However I don't think it makes
> any difference.
>
> > and Open a a.ttcn file, the mode is still Fundamental.
> > Using the line, when I open the file a.ttcn, the mode line show the
> > Major mode is : TTCN-3 without hight-light and indent feature.
>
> > Yes, the ttcn3.el need the module --compile, easymenu and others.
> > Emacs can load the ttcn3.el well, can I think all these dependency is
> > meet?
>
> In ttcn3.el, the
> (require 'foo)
> lines will check if "foo" is already loaded by examining the
> variable "features".
>
> You can use
> C-h v features
> to get a list of the loaded features.
>
> If "foo" is not in "features", then (load-library '"foo")
> will be called. This will search the paths defined in
> the variable "load-path", for foo.elc or foo.el.
>
> .elc is "Emacs Lisp, Compiled", and .el is "Emacs Lisp" (source).
>
> You can use (add-path '"/some/path") to modify the path list.
>
> Finally, the foo.el should do (provide 'foo) to confirm to Emacs
> that it has initialised correctly.
>
> Could you copy in a buffer the requires from ttcn3.el
> (require 'cc-mode)                      ; ttcn-3-mode inherits from cc-mode
> (require 'cc-langs)                     ; e.g. c-make-inherited-keymap
> (require 'compile)                      ; and this for compile-interal,
> (require 'easymenu)                     ; and uses easymenu,
> (require 'font-lock)                    ; font-lock,
> (require 'imenu)                        ; and imenu
>
> select them, and then press
> M-x eval-region
>
> Is an error reported?
>
> After this, what is the value of "features" ?
>
> HTH,
> Colin S. Miller
>
> --
> Replace the obvious in my email address with the first three letters of the 
> hostname to reply.

Thanks Colin's great help.

I've got the features of my emacs, below is the result:

features is a variable defined in `C source code'.
Its value is
(help-fns help-mode view browse-url url-util url-parse url-vars mm-
util mail-prsvr ttcn3 speedbar sb-image ezimage dframe assoc imenu
compile comint ring cc-langs cc-mode cc-fonts cc-menus cc-cmds cc-
styles cc-align cc-engine cc-vars cc-defs session desktop highlight-
symbol easy-mmode hi-lock thingatpt color-theme edmacro kmacro wid-
edit cl cl-19 sendmail regexp-opt reporter easymenu server encoded-kb
china-util tooltip ediff-hook vc-hooks lisp-float-type dos-w32 disp-
table ls-lisp w32-win w32-vars tool-bar mwheel dnd fontset image
fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-
viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook
help simple abbrev loaddefs button minibuffer faces cus-face text-
properties overlay md5 base64 format env code-pages mule custom widget
backquote make-network-process multi-tty emacs)

>From that I know all these dependency has been loaded.

> (require 'cc-mode)                      ; ttcn-3-mode inherits from cc-mode
> (require 'cc-langs)                     ; e.g. c-make-inherited-keymap
> (require 'compile)                      ; and this for compile-interal,
> (require 'easymenu)                     ; and uses easymenu,
> (require 'font-lock)                    ; font-lock,
> (require 'imenu)                        ; and imenu
>
> select them, and then press
> M-x eval-region
After running these lisp code, no error is reported.

Currently I use below configuration to lauch the TTCN3.

(add-to-list 'load-path "~/emacs_lib/ttcn-el-0.6.9")
(require 'ttcn3)
(setq auto-mode-alist (cons '("\\.ttcn3?" . ttcn-3-mode) auto-mode-
alist)

But getting wrong info:
File mode specification error: (error "Buffer CoffeeSuite.ttcn3 is not
a CC Mode buffer (c-set-style)")

Any the emacs version I used on windows is emacs 23.1.

I also try to install the ttcn3 on Ubuntu by running : sudo apt-get
install ttcn.el. All is going well. But when I open a ttcn3 file, it
give me the same error info:
File mode specification error: (error "Buffer CoffeeSuite.ttcn3 is not
a CC Mode buffer (c-set-style)")
I checked the version on my ubuntu is emacs 22.

I was so confused, Is this a bug?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]