GNU bug report logs - #57470
fill-column icon on the ruler is wrongly placed

Previous Next

Package: emacs;

Reported by: uzibalqa <uzibalqa <at> proton.me>

Date: Mon, 29 Aug 2022 05:10:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57470 in the body.
You can then email your comments to 57470 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 05:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to uzibalqa <uzibalqa <at> proton.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 29 Aug 2022 05:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: uzibalqa <uzibalqa <at> proton.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 05:09:32 +0000
Have changed fill-column through mode-hooks for org-mode and text-mode only as follows

     (defun colum-property () (setq fill-column 72))

     (add-hook 'org-mode-hook   #'colum-property)

     (add-hook 'text-mode-hook  #'colum-property)

But when I load a "tex" or "texi" file, then call "M-x ruler-mode", the ruler takes the 
value 72 for fill-column when displaying the fill-column icon on the ruler.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 29 Aug 2022 11:27:01 GMT) Full text and rfc822 format available.

Notification sent to uzibalqa <uzibalqa <at> proton.me>:
bug acknowledged by developer. (Mon, 29 Aug 2022 11:27:01 GMT) Full text and rfc822 format available.

Message #10 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: uzibalqa <uzibalqa <at> proton.me>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 14:26:27 +0300
> Date: Mon, 29 Aug 2022 05:09:32 +0000
> From:  uzibalqa via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Have changed fill-column through mode-hooks for org-mode and text-mode only as follows
> 
>      (defun colum-property () (setq fill-column 72))
> 
>      (add-hook 'org-mode-hook   #'colum-property)
> 
>      (add-hook 'text-mode-hook  #'colum-property)
> 
> But when I load a "tex" or "texi" file, then call "M-x ruler-mode", the ruler takes the 
> value 72 for fill-column when displaying the fill-column icon on the ruler.

Because the modes for TeX and Texinfo files inherit from Text mode.
For example, the doc string for latex-mode says, inter alia:

  Entering Latex mode runs the hook ‘text-mode-hook’, then
  ‘tex-mode-hook’, and finally ‘latex-mode-hook’.  When the special
  subshell is initiated, ‘tex-shell-hook’ is run.

Note the reference to text-mode-hook.

This is not a bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 12:05:01 GMT) Full text and rfc822 format available.

Message #13 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: uzibalqa <uzibalqa <at> proton.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 12:04:43 +0000
------- Original Message -------
On Monday, August 29th, 2022 at 11:26 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:


> > Date: Mon, 29 Aug 2022 05:09:32 +0000
> > From: uzibalqa via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > 
> > Have changed fill-column through mode-hooks for org-mode and text-mode only as follows
> > 
> > (defun colum-property () (setq fill-column 72))
> > 
> > (add-hook 'org-mode-hook #'colum-property)
> > 
> > (add-hook 'text-mode-hook #'colum-property)
> > 
> > But when I load a "tex" or "texi" file, then call "M-x ruler-mode", the ruler takes the
> > value 72 for fill-column when displaying the fill-column icon on the ruler.
> 
> 
> Because the modes for TeX and Texinfo files inherit from Text mode.
> For example, the doc string for latex-mode says, inter alia:
> 
> Entering Latex mode runs the hook ‘text-mode-hook’, then
> ‘tex-mode-hook’, and finally ‘latex-mode-hook’. When the special
> subshell is initiated, ‘tex-shell-hook’ is run.
> 
> Note the reference to text-mode-hook.
> 
> This is not a bug.

It is very confusing.  I thought it was related to prog-mode-hook (reason I made request
for way to list associated modes).  Looks like there is ever greater need now for things
that help us without excessive need to go into internals.  Am quite sure that emacs internal
design is rather atrocious for even experienced programmers to understand efficiently.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 12:18:02 GMT) Full text and rfc822 format available.

Message #16 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Dimech <dimech <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: uzibalqa <at> proton.me, 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 14:17:11 +0200
> Sent: Tuesday, August 30, 2022 at 12:04 AM
> From: "uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> To: "Eli Zaretskii" <eliz <at> gnu.org>
> Cc: 57470-done <at> debbugs.gnu.org
> Subject: bug#57470: fill-column icon on the ruler is wrongly placed
>
> ------- Original Message -------
> On Monday, August 29th, 2022 at 11:26 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> 
> > > Date: Mon, 29 Aug 2022 05:09:32 +0000
> > > From: uzibalqa via "Bug reports for GNU Emacs,
> > > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > > 
> > > Have changed fill-column through mode-hooks for org-mode and text-mode only as follows
> > > 
> > > (defun colum-property () (setq fill-column 72))
> > > 
> > > (add-hook 'org-mode-hook #'colum-property)
> > > 
> > > (add-hook 'text-mode-hook #'colum-property)
> > > 
> > > But when I load a "tex" or "texi" file, then call "M-x ruler-mode", the ruler takes the
> > > value 72 for fill-column when displaying the fill-column icon on the ruler.
> > 
> > 
> > Because the modes for TeX and Texinfo files inherit from Text mode.
> > For example, the doc string for latex-mode says, inter alia:
> > 
> > Entering Latex mode runs the hook ‘text-mode-hook’, then
> > ‘tex-mode-hook’, and finally ‘latex-mode-hook’. When the special
> > subshell is initiated, ‘tex-shell-hook’ is run.
> > 
> > Note the reference to text-mode-hook.
> > 
> > This is not a bug.

I clash with the concept that text-mode-hook would affect tex-mode and latex-mode.
Can understand that prog-mode-hook is evidently trying to affect  programming language
modes.  But not so evident that users can naturally associate text-mode-hook as a hook
encompassing a category of internally text-mode derived modes.

 
> It is very confusing.  I thought it was related to prog-mode-hook (reason I made request
> for way to list associated modes).  Looks like there is ever greater need now for things
> that help us without excessive need to go into internals.  Am quite sure that emacs internal
> design is rather atrocious for even experienced programmers to understand efficiently.
> 
> 
> 
> 
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 13:13:02 GMT) Full text and rfc822 format available.

Message #19 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: uzibalqa <uzibalqa <at> proton.me>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 16:13:13 +0300
> Date: Mon, 29 Aug 2022 12:04:43 +0000
> From: uzibalqa <uzibalqa <at> proton.me>
> Cc: 57470-done <at> debbugs.gnu.org
> 
> > Entering Latex mode runs the hook ‘text-mode-hook’, then
> > ‘tex-mode-hook’, and finally ‘latex-mode-hook’. When the special
> > subshell is initiated, ‘tex-shell-hook’ is run.
> > 
> > Note the reference to text-mode-hook.
> > 
> > This is not a bug.
> 
> It is very confusing.  I thought it was related to prog-mode-hook (reason I made request
> for way to list associated modes).  Looks like there is ever greater need now for things
> that help us without excessive need to go into internals.  Am quite sure that emacs internal
> design is rather atrocious for even experienced programmers to understand efficiently.

You need to consult the documentation, yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 14:54:02 GMT) Full text and rfc822 format available.

Message #22 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: uzibalqa <uzibalqa <at> proton.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 14:53:14 +0000
------- Original Message -------
On Monday, August 29th, 2022 at 1:13 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:


> > Date: Mon, 29 Aug 2022 12:04:43 +0000
> > From: uzibalqa uzibalqa <at> proton.me
> > Cc: 57470-done <at> debbugs.gnu.org
> > 
> > > Entering Latex mode runs the hook ‘text-mode-hook’, then
> > > ‘tex-mode-hook’, and finally ‘latex-mode-hook’. When the special
> > > subshell is initiated, ‘tex-shell-hook’ is run.
> > > 
> > > Note the reference to text-mode-hook.
> > > 
> > > This is not a bug.
> > 
> > It is very confusing. I thought it was related to prog-mode-hook (reason I made request
> > for way to list associated modes). Looks like there is ever greater need now for things
> > that help us without excessive need to go into internals. Am quite sure that emacs internal
> > design is rather atrocious for even experienced programmers to understand efficiently.
> 
> 
> 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. 

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.

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






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 16:18:01 GMT) Full text and rfc822 format available.

Message #25 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: uzibalqa <uzibalqa <at> proton.me>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: 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 <at> proton.me>
> Cc: 57470-done <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57470; Package emacs. (Mon, 29 Aug 2022 16:41:01 GMT) Full text and rfc822 format available.

Message #28 received at 57470-done <at> debbugs.gnu.org (full text, mbox):

From: uzibalqa <uzibalqa <at> proton.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57470-done <at> debbugs.gnu.org
Subject: Re: bug#57470: fill-column icon on the ruler is wrongly placed
Date: Mon, 29 Aug 2022 16:40:31 +0000
------ Original Message -------
On Monday, August 29th, 2022 at 4:17 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:


> > Date: Mon, 29 Aug 2022 14:53:14 +0000
> > From: uzibalqa uzibalqa <at> proton.me
> > Cc: 57470-done <at> 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.

They would be of interest to emacs package developers who are at an intermediate level
in an elisp context.  Some support functions to make things easier to figure out would
help.
 
> 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

Thank you. 
 
> 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.

Running some elisp commands would work better though.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.