unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57470: fill-column icon on the ruler is wrongly placed
@ 2022-08-29  5:09 uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-29 11:26 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-29  5:09 UTC (permalink / raw)
  To: 57470


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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29  5:09 bug#57470: fill-column icon on the ruler is wrongly placed uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-29 11:26 ` Eli Zaretskii
  2022-08-29 12:04   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-08-29 11:26 UTC (permalink / raw)
  To: uzibalqa; +Cc: 57470-done

> 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@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 11:26 ` Eli Zaretskii
@ 2022-08-29 12:04   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-29 12:17     ` Christopher Dimech
  2022-08-29 13:13     ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-29 12:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57470-done

------- Original Message -------
On Monday, August 29th, 2022 at 11:26 AM, Eli Zaretskii <eliz@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@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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 12:04   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-29 12:17     ` Christopher Dimech
  2022-08-29 13:13     ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Christopher Dimech @ 2022-08-29 12:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: uzibalqa, 57470-done


> 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@gnu.org>
> To: "Eli Zaretskii" <eliz@gnu.org>
> Cc: 57470-done@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@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@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.
> 
> 
> 
> 
>





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 12:04   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-29 12:17     ` Christopher Dimech
@ 2022-08-29 13:13     ` Eli Zaretskii
  2022-08-29 14:53       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-08-29 13:13 UTC (permalink / raw)
  To: uzibalqa; +Cc: 57470-done

> Date: Mon, 29 Aug 2022 12:04:43 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: 57470-done@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 13:13     ` Eli Zaretskii
@ 2022-08-29 14:53       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-29 16:17         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-29 14:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57470-done

------- Original Message -------
On Monday, August 29th, 2022 at 1:13 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Mon, 29 Aug 2022 12:04:43 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: 57470-done@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.  







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 14:53       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-29 16:17         ` Eli Zaretskii
  2022-08-29 16:40           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-08-29 16:17 UTC (permalink / raw)
  To: uzibalqa; +Cc: 57470-done

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#57470: fill-column icon on the ruler is wrongly placed
  2022-08-29 16:17         ` Eli Zaretskii
@ 2022-08-29 16:40           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 8+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-29 16:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57470-done

------ Original Message -------
On Monday, August 29th, 2022 at 4:17 PM, Eli Zaretskii <eliz@gnu.org> wrote:


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

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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-29 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  5:09 bug#57470: fill-column icon on the ruler is wrongly placed uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 11:26 ` Eli Zaretskii
2022-08-29 12:04   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 12:17     ` Christopher Dimech
2022-08-29 13:13     ` Eli Zaretskii
2022-08-29 14:53       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 16:17         ` Eli Zaretskii
2022-08-29 16:40           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).