all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthias Dahl <ml_emacs-lists@binary-island.eu>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: conditionally enabling a mode in define-minor-mode context
Date: Sun, 11 May 2014 10:50:20 +0200	[thread overview]
Message-ID: <536F39CC.6080506@binary-island.eu> (raw)

Hello @all...

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.

Basically, it is a global minor mode w/ a snobbish attitude. ;)

I cannot get my head around it how to do this w/ define-minor-mode and
define-globalized-minor-mode.

Is this possible? Or am I going at it from the wrong angle and there is
a more Emacs/elisp idiomatic way to approach this kind of problem?

Thanks a lot in advance for each and every help. :)

So long,
Matthias

-- 
Dipl.-Inf. (FH) Matthias Dahl | Software Engineer | binary-island.eu
 services: custom software [desktop, mobile, web], server administration



             reply	other threads:[~2014-05-11  8:50 UTC|newest]

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

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

  git send-email \
    --in-reply-to=536F39CC.6080506@binary-island.eu \
    --to=ml_emacs-lists@binary-island.eu \
    --cc=help-gnu-emacs@gnu.org \
    /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.