unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Matthias Dahl <ml_emacs-lists@binary-island.eu>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: conditionally enabling a mode in define-minor-mode context
Date: Sun, 11 May 2014 12:30:34 -0700 (PDT)	[thread overview]
Message-ID: <32b5873c-d585-4b25-a81c-94fc2c0648e2@default> (raw)
In-Reply-To: <536F39CC.6080506@binary-island.eu>

> I'm currently working on a new minor mode which requires that for every
> newly opened buffer/file which matches several dynamic conditions, it
> enables itself (that is key bindings, lighter and such) and otherwise it
> silently does nothing (no key bindings, lighter or whatever). Those
> conditions go beyond simply tying it to certain major modes or alike.
> 
> Is this possible?

Without thinking much about it, I'm guessing you could define two minor
modes, one of which you turn on everywhere and which controls the
conditional enabling of the other.  Again, just a thought, without
reflection - ignore if not helpful.



  reply	other threads:[~2014-05-11 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11  8:50 conditionally enabling a mode in define-minor-mode context Matthias Dahl
2014-05-11 19:30 ` Drew Adams [this message]
2014-05-13 15:14   ` Matthias Dahl

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=32b5873c-d585-4b25-a81c-94fc2c0648e2@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ml_emacs-lists@binary-island.eu \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).