all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: define-key for a major-mode, 'face and external program
Date: Tue, 11 Sep 2012 20:45:03 -0400	[thread overview]
Message-ID: <jwvoblcgjir.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.8626.1347376754.855.help-gnu-emacs@gnu.org

> can you please help me with the following LISP code?

Looks fine.

> (define-derived-mode rct-mode special-mode "rct:main"
>   "Major mode for remote connections
> \\{rct-main-mode-map}."
>   (setq debug-on-error t)

Don't use `setq' in a major-mode since the change will affect
all buffers.  Better use (set (make-local-variable 'debug-on-error) t).

>   (use-local-map rct-mode-map)
>   (run-hooks 'rct-mode-hook)

Don't do that, it's done by `define-derived-mode already.

>   (main-menu))

This shouldn't be in the major-mode function, but in another function
(which will probably call the major-mode function).

>   (switch-to-buffer rct-mode-buffer-name)

You should probably call pop-to-buffer here instead.


        Stefan


  parent reply	other threads:[~2012-09-12  0:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08 22:38 define-key for a major-mode, 'face and external program pascal chenevas
2012-09-11 15:18 ` pascal chenevas
     [not found] ` <mailman.8626.1347376754.855.help-gnu-emacs@gnu.org>
2012-09-12  0:45   ` Stefan Monnier [this message]
2012-09-12  9:10     ` pascal chenevas
     [not found]     ` <mailman.8702.1347441052.855.help-gnu-emacs@gnu.org>
2012-09-13  3:46       ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=jwvoblcgjir.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.