unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Luca Ferrari <fluca1978@infinito.it>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: help about comment for major mode
Date: Fri, 1 Feb 2013 13:11:19 +0100	[thread overview]
Message-ID: <CAKoxK+6UONLk_7L+iqJ1XHfV2SexXDRO4ZDF29532Nxfu=PiuQ@mail.gmail.com> (raw)

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	other threads:[~2013-02-01 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 12:11 Luca Ferrari [this message]
2013-02-01 20:49 ` help about comment for major mode Stefan Monnier
2013-02-04  7:29   ` Luca Ferrari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKoxK+6UONLk_7L+iqJ1XHfV2SexXDRO4ZDF29532Nxfu=PiuQ@mail.gmail.com' \
    --to=fluca1978@infinito.it \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).