help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does the role of minor-mode-alist variable is to only help in displa


From: W . Greenhouse
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Talespin Kit <talespin_kit@yahoo.com> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]