unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: angelomolina@tutanota.com
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: About the activation of minor modes
Date: Sun, 6 Mar 2022 00:06:55 -0300	[thread overview]
Message-ID: <CADs++6jFVo1CB7+8ruKyJe0jmrRO+-4=4mseMzMUokC3YswpeQ@mail.gmail.com> (raw)
In-Reply-To: <MxMxT27--3-2@tutanota.com>

On Fri, 4 Mar 2022 at 23:48, angelomolina--- via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Can a minor mode activate another minor-mode or functionalities residing in other files ?  I ask because I would like my tools to be organised according to some categorisation criteria' rather than all being huddled together.


Hi Angelo,

I don't know if this idea will help or not, but this is how I would
try to find the answer...

The function `find-epp' of eev pretty-prints its argument and shows
the result in a temporary buffer, and this

  (find-epp (macroexpand '

    (define-minor-mode A-mode
      "Help for A-mode"
      :init-value nil
      :global nil
      :lighter " A")

  ))

shows exactly what this `define-minor-mode' does. I _guess_ that it
should be easy to modify the (define-minor-mode A-mode ...) sexp bit
by bit until you get something that turns on and off B-mode when
A-mode is turned on and off - and if you use

  :lighter " B"

in your definition of B-mode then you'll be able to check if B mode
was turned on and off by just looking at the mode line.

Some people like to learn things using this approach and some hate it.
For more info on that, see:

  http://angg.twu.net/find-elisp-intro.html

and for more (basic) info on eev, see:

  http://angg.twu.net/2020-list-packages-eev-nav.html

Cheers and happy hacking =),
  Eduardo Ochs
  http://angg.twu.net/#eev



  parent reply	other threads:[~2022-03-06  3:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-05  2:47 About the activation of minor modes angelomolina--- via Users list for the GNU Emacs text editor
2022-03-05  6:20 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-05 15:37   ` angelomolina--- via Users list for the GNU Emacs text editor
2022-03-05 21:49     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-05 22:20     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-07 23:01       ` angelomolina--- via Users list for the GNU Emacs text editor
2022-03-08 18:06         ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-08 23:09           ` angelomolina--- via Users list for the GNU Emacs text editor
2022-03-09  0:08             ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-09  9:46               ` angelomolina--- via Users list for the GNU Emacs text editor
2022-03-09 10:24               ` angelomolina--- via Users list for the GNU Emacs text editor
2022-03-06  3:06 ` Eduardo Ochs [this message]
2022-03-06  5:01   ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-06  5:26     ` Eduardo Ochs
2022-03-06  6:08       ` Emanuel Berg via Users list for the GNU Emacs text editor

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='CADs++6jFVo1CB7+8ruKyJe0jmrRO+-4=4mseMzMUokC3YswpeQ@mail.gmail.com' \
    --to=eduardoochs@gmail.com \
    --cc=angelomolina@tutanota.com \
    --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.
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).