unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: W. Greenhouse <wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: Re: Does the role of minor-mode-alist variable is to only help in displaying the mode name?
Date: Sun, 09 Feb 2014 18:16:56 +0000	[thread overview]
Message-ID: <87fvnsywvb.fsf@tachikoma.kusanagi> (raw)
In-Reply-To: 1391866610.96105.YahooMailBasic@web126006.mail.ne1.yahoo.com

Talespin Kit <talespin_kit-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> writes:

> In the elisp document the role of the minor-mode-alist variable is
> described as below.
>
>
> 23.3.1 Conventions for Writing Minor Modes
> ----------------------------------------------------------------
>
>  Add an element to `minor-mode-alist' for each minor mode (*note
>      Definition of minor-mode-alist::), if you want to indicate the
>      minor mode in the mode line. 
>
> But the function "describe-mode" uses the variable "minor-mode-alist"
> to find the list of minor modes. Does this mean the document is to be
> updated. Because it gives the impression the information about the
> minor modes are stored somewhere else. Although i am not able to find
> it out.

Yes, `describe-mode' uses `major-mode' to discover which major mode's
documentation to show and `minor-mode-alist' to discover which minor
modes' documentation to show.  There is no other listing of enabled
minor modes.  It should therefore be considered not merely a breach of
convention but a serious design flaw if a major or minor mode fails to
set these variables.  Fortunately, most major modes are created with
`define-derived-mode' and most minor modes with `define-minor-mode',
which take care of these and other mode-related bureaucratic tasks
automatically.

Perhaps the language of (info "(elisp) Minor Mode Conventions") could be
strengthened to match that of (info "(elisp) Major Mode Conventions"),
which says:

--8<---------------cut here---------------start------------->8---
   * The major mode command should set the variable `major-mode' to the
     major mode command symbol.  This is how `describe-mode' discovers
     which documentation to print.
--8<---------------cut here---------------end--------------->8---

Hope that clarifies things a bit.




      reply	other threads:[~2014-02-09 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 13:36 Does the role of minor-mode-alist variable is to only help in displaying the mode name? Talespin Kit
2014-02-09 18:16 ` W. Greenhouse [this message]

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=87fvnsywvb.fsf@tachikoma.kusanagi \
    --to=wgreenhouse-sgozh3hwpm2stnjn9+bgxg@public.gmane.org \
    --cc=help-gnu-emacs-mXXj517/zsQ@public.gmane.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).