From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: define-key for a major-mode, 'face and external program Date: Tue, 11 Sep 2012 20:45:03 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347410714 23445 80.91.229.3 (12 Sep 2012 00:45:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2012 00:45:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 02:45:18 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TBb4u-0005cF-Hz for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2012 02:45:16 +0200 Original-Received: from localhost ([::1]:41078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBb4q-00089v-Ok for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2012 20:45:12 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe23.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:iC7FE3XWy5BOX3uWQUStXollnns= Original-Lines: 28 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Wed, 12 Sep 2012 00:45:04 UTC X-Received-Bytes: 1510 Original-Xref: usenet.stanford.edu gnu.emacs.help:194387 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86729 Archived-At: > 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