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

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

Re: add argument to a derived-mode


From: Joe Riel
Subject: Re: add argument to a derived-mode
Date: Sun, 15 Jan 2017 12:49:48 -0800

On Fri, 13 Jan 2017 09:37:07 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > Is there a way to use define-derived-mode to
> > create a major mode that takes an argument if
> > the base mode does not?
> 
> Major modes do not take arguments, no.
> Instead, you'll want to define 2 functions:
> - a major mode
> - the function you want, with its argument, and which internally calls
>   the major mode.

Is it a requirement that major modes not take an argument?
In my case the major modes are not invoked interactively,
so having a required argument isn't a practical problem.
However, if it's considered bad form to pass arguments to them,
I'll make the change, which would allow using define-derived-mode.

-- 
Joe Riel




reply via email to

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