all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joe Riel <joer@san.rr.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: add argument to a derived-mode
Date: Sun, 15 Jan 2017 12:49:48 -0800	[thread overview]
Message-ID: <20170115124948.5534e9cc@gauss> (raw)
In-Reply-To: <jwv4m13uiw5.fsf-monnier+gmane.emacs.help@gnu.org>

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	other threads:[~2017-01-15 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  0:38 add argument to a derived-mode Joe Riel
2017-01-13 14:37 ` Stefan Monnier
2017-01-15 20:49   ` Joe Riel [this message]
2017-01-15 22:33     ` Stefan Monnier
2017-01-16  1:53       ` Joe Riel

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=20170115124948.5534e9cc@gauss \
    --to=joer@san.rr.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.