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

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

Re: how to define a comment syntax for files having a specific extension


From: gento
Subject: Re: how to define a comment syntax for files having a specific extension?
Date: 3 Apr 2007 03:51:38 -0700
User-agent: G2/1.0

> (require 'cl)
> (push `(\\.jou$" . ,(lambda ()
>                        (text-mode)
>                        (setf comment-start "/")))
>       auto-mode-alist)

It has worked !

> Also you could do it with a find-file-hook, etc.

I've  actually preferred this solution

(add-hook 'find-file-hooks
     (lambda ()
        (when (string-match "\\.jou$" (buffer-file-name))
           (setq comment-start "/")
        )
     )
)

that I have adapted on the basis of your post
http://groups.google.it/group/gnu.emacs.help/msg/83d7d3c1217a98b2

thank you



reply via email to

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