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

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

Re: define-key for a major-mode, 'face and external program


From: Stefan Monnier
Subject: Re: define-key for a major-mode, 'face and external program
Date: Wed, 12 Sep 2012 23:46:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

> (defcustom rct-mode-hook nil
>        "Normal hook run when entering rct mode and many related modes."
>        :type 'hook
>        :options '(font-lock-mode t)
>        :group 'rct)

> Actualy I don't know if it's usefull to add the property :options.

It's not very useful and `t' is not a valid value there (and
font-lock-mode is enabled by default, so very few people will want to
enable explicitly just for your mode).
BTW, this whole defcustom is unneeded since define-derived-mode already
defines the `rct-mode-hook' for you.

> I get an error:
> Debugger entered--Lisp error: (void-function add-hooks)

The error says you're calling a function that doesn't exist.

>     (add-hooks 'rct-mode-hook)

There's `run-hooks' (which you don't need to call since
define-derived-mode does that for you), and there's `add-hook' which
requires one more argument and would be used in the user's .emacs file
rather than in your code.


        Stefan


reply via email to

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