unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* help about comment for major mode
@ 2013-02-01 12:11 Luca Ferrari
  2013-02-01 20:49 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Ferrari @ 2013-02-01 12:11 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help about comment for major mode
  2013-02-01 12:11 help about comment for major mode Luca Ferrari
@ 2013-02-01 20:49 ` Stefan Monnier
  2013-02-04  7:29   ` Luca Ferrari
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-02-01 20:49 UTC (permalink / raw)
  To: help-gnu-emacs

> I'm still having some problems with defining the comments for a new
> major mode.

*Please* take a look at http://www.emacswiki.org/cgi-bin/wiki?SampleMode

There's no need to define a new comment-dwin and rebind the
corresponding key.  Just set comment-start, comment-end, ...

        
        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help about comment for major mode
  2013-02-01 20:49 ` Stefan Monnier
@ 2013-02-04  7:29   ` Luca Ferrari
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Ferrari @ 2013-02-04  7:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

> There's no need to define a new comment-dwin and rebind the
> corresponding key.  Just set comment-start, comment-end, ...
>

Thanks, it is working fine now!

Luca



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-04  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 12:11 help about comment for major mode Luca Ferrari
2013-02-01 20:49 ` Stefan Monnier
2013-02-04  7:29   ` Luca Ferrari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).