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

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

help about comment for major mode


From: Luca Ferrari
Subject: help about comment for major mode
Date: Fri, 1 Feb 2013 13:11:19 +0100

Hi,
I'm still having some problems with defining the comments for a new
major mode. In my code I've the following function (that works if
called directly with M-x):

(defun dataflex-comment-dwim (arg)
  "Comment (in/out) a Dataflex piece of source code.
It is based on comment-dwin of newcomment.el"
  (interactive "*P")
  (require 'newcomment)
  (let ( (comment-start "// * ") (comment-end " * ") (comment-style 'box) )
    (comment-dwim arg)))

and in the symbol table I've got:

    (modify-syntax-entry ?/ ". 12b" df-syn-table)      ; c++-like
comment with //                         ;;
    (modify-syntax-entry ?\n "> b" df-syn-table)        ; end of c++-like
comment by newline                      ;;


and then I've got the following in the map:

(define-key df-map [remap comment-dwim] 'dataflex-comment-dwim )

However, if I do a describe key for M-; in my mode I got comment-dwim
and in fact, if I do M-; I got an error saying that "No comment syntax
defined. Use:". What am I missing here?

Thanks,
Luca



reply via email to

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