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

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

bug#57470: fill-column icon on the ruler is wrongly placed


From: Eli Zaretskii
Subject: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 19:17:23 +0300

> Date: Mon, 29 Aug 2022 14:53:14 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: 57470-done@debbugs.gnu.org
> 
> > You need to consult the documentation, yes.
> 
> "C-v text-mode-hook" really states that it is 
> "Normal hook run when entering Text mode and many related modes."
> 
> "Many related modes", basically tells you nothing. 

It tells me that there are other modes affected.

You cannot expect every place in the documentation to tell absolutely
everything, that would make the documentation impossibly large and
hard to maintain.  You need to learn the basics of how to follow links
and where to find information of certain kinds.

> I can understand your comment about keeping in mind that every mode for
> something that looks like a programming language inherits from prog-mode.
> 
> But cannot understand any good comment to keep in mind regarding 
> text-mode-hook.

>From the Emacs manual's node "Text Mode":

  Text mode is a major mode for editing files of text in a human language.
  Files which have names ending in the extension ‘.txt’ are usually opened
  in Text mode (*note Choosing Modes::).  To explicitly switch to Text
  mode, type ‘M-x text-mode’.
  [...]
     The following sections describe several major modes that are
  “derived” from Text mode.  These derivatives share most of the features
  of Text mode described above.  In particular, derivatives of Text mode
  run ‘text-mode-hook’ prior to running their own mode hooks.

> Emacs should have some automatic mechanism that determines an association tree
> on how modes extend to others.  

I don't see why users should care about the hierarchy of modes in
Emacs.  That's something that Emacs developers and maintainers are
interested in, not users.

Users should have a way of telling whether a given mode is derived
from another one.  For that, you can use the derived-mode-parent
property:

  M-: (get 'latex-mode 'derived-mode-parent) RET
    => tex-mode
  M-: (get 'tex-mode 'derived-mode-parent) RET
    => text-mode

Alternatively, in a buffer that is already in latex-mode, you can ask
whether it inherits from text-mode:

  M-: (derived-mode-p 'text-mode) RET
    => text-mode

And, of course, the doc string of a mode should tell which hooks it
runs and which mode is its parent mode.  By following the parent-mode
links you can, if you really want to, go all the way to their
progenitor.





reply via email to

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