all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* headings for texinfo-mode using outline-minor-mode
@ 2021-05-11 16:43 pietru
  2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-12  2:16 ` pietru
  0 siblings, 2 replies; 20+ messages in thread
From: pietru @ 2021-05-11 16:43 UTC (permalink / raw)
  To: Help Gnu Emacs

What do headings start with for texinfo-mode, when using outline-minor-mode?





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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-11 16:43 headings for texinfo-mode using outline-minor-mode pietru
@ 2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-12  4:43   ` pietru
  2021-05-12  5:11   ` pietru
  2021-05-12  2:16 ` pietru
  1 sibling, 2 replies; 20+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-11 17:26 UTC (permalink / raw)
  To: help-gnu-emacs

pietru@caramail.com [2021-05-11 18:43:16] wrote:
> What do headings start with for texinfo-mode, when using outline-minor-mode?

`texinfo-mode` is one of the rare modes which explicitly sets
`outline-heading-alist`, so you have the answer in there ;-)


        Stefan




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

* headings for texinfo-mode using outline-minor-mode
  2021-05-11 16:43 headings for texinfo-mode using outline-minor-mode pietru
  2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-12  2:16 ` pietru
  2021-05-12  2:39   ` pietru
  1 sibling, 1 reply; 20+ messages in thread
From: pietru @ 2021-05-12  2:16 UTC (permalink / raw)
  To: Help Gnu Emacs

I want to use my own heading levels in texinfo as I also have
my own sectioning macros @uchap, @usec, @usubsec, @usubsubsec.

But I require some help setting things up.

(defun outline-mesh-texinfo ()
   "todo"

   (setq outline-heading-alist
	 '(("@chapter" . 2)
	   ("@section" . 3)
	   ("@subsection" . 4)
	   ("@subsubsection" . 5)
	   ;; ---------------------------------------------------
           ("@unnumbered" . 2)
	   ("@unnumberedsec" . 3)
	   ("@unnumberedsubsec" . 4)
	   ("@unnumberedsubsubsec" . 5)
           ;; ---------------------------------------------------
           ("@appendix" . 2)
	   ("@appendixsec" . 3)...
           ("@appendixsubsec" . 4)
	   ("@appendixsubsubsec" . 5)
           ;; ---------------------------------------------------
	   ("@chap" . 2)
	   ("@usec" . 3)
	   ("@usubsec" . 4)
	   ("@usubsubsec" . 5) ))

   (add-hook 'texinfo-mode-hook #'???)

   )





> Sent: Wednesday, May 12, 2021 at 4:43 AM
> From: pietru@caramail.com
> To: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: headings for texinfo-mode using outline-minor-mode
>
> What do headings start with for texinfo-mode, when using outline-minor-mode?
>
>
>
>



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

* headings for texinfo-mode using outline-minor-mode
  2021-05-12  2:16 ` pietru
@ 2021-05-12  2:39   ` pietru
  0 siblings, 0 replies; 20+ messages in thread
From: pietru @ 2021-05-12  2:39 UTC (permalink / raw)
  To: pietru; +Cc: Help Gnu Emacs

I have found it better to have a separate function that sets "outline-heading-alist"
for a specific language, then I can do my add-hook to the "hdlevels" function.

Still I think that my crode needs some more beef.


(defun gilgamesh-texinfo-hdlevels ()
    "todo"

   (setq outline-heading-alist
	 '(("@chapter" . 2)
	   ("@section" . 3)
	   ("@subsection" . 4)
	   ("@subsubsection" . 5)
	   ;; ---------------------------------------------------
           ("@unnumbered" . 2)
	   ("@unnumberedsec" . 3)
	   ("@unnumberedsubsec" . 4)
	   ("@unnumberedsubsubsec" . 5)
           ;; ---------------------------------------------------
           ("@appendix" . 2)
	   ("@appendixsec" . 3)...
           ("@appendixsubsec" . 4)
	   ("@appendixsubsubsec" . 5)
           ;; ---------------------------------------------------
	   ("@uchap" . 2)
	   ("@usec" . 3)
	   ("@usubsec" . 4)
	   ("@usubsubsec" . 5) ..)) )

(defun gilgamesh-texinfo ()
   "todo"
   (add-hook 'texinfo-mode-hook #'gilgamesh-texinfo-hdlevels) )




> Sent: Wednesday, May 12, 2021 at 2:16 PM
> From: pietru@caramail.com
> To: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: headings for texinfo-mode using outline-minor-mode
>
> I want to use my own heading levels in texinfo as I also have
> my own sectioning macros @uchap, @usec, @usubsec, @usubsubsec.
>
> But I require some help setting things up.
>
> (defun outline-mesh-texinfo ()
>    "todo"
>
>    (setq outline-heading-alist
> 	 '(("@chapter" . 2)
> 	   ("@section" . 3)
> 	   ("@subsection" . 4)
> 	   ("@subsubsection" . 5)
> 	   ;; ---------------------------------------------------
>            ("@unnumbered" . 2)
> 	   ("@unnumberedsec" . 3)
> 	   ("@unnumberedsubsec" . 4)
> 	   ("@unnumberedsubsubsec" . 5)
>            ;; ---------------------------------------------------
>            ("@appendix" . 2)
> 	   ("@appendixsec" . 3)...
>            ("@appendixsubsec" . 4)
> 	   ("@appendixsubsubsec" . 5)
>            ;; ---------------------------------------------------
> 	   ("@chap" . 2)
> 	   ("@usec" . 3)
> 	   ("@usubsec" . 4)
> 	   ("@usubsubsec" . 5) ))
>
>    (add-hook 'texinfo-mode-hook #'???)
>
>    )
>
>
>
>
>
> > Sent: Wednesday, May 12, 2021 at 4:43 AM
> > From: pietru@caramail.com
> > To: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> > Subject: headings for texinfo-mode using outline-minor-mode
> >
> > What do headings start with for texinfo-mode, when using outline-minor-mode?
> >
> >
> >
> >
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-12  4:43   ` pietru
  2021-05-12 12:34     ` Stefan Monnier
  2021-05-12 12:36     ` Jean Louis
  2021-05-12  5:11   ` pietru
  1 sibling, 2 replies; 20+ messages in thread
From: pietru @ 2021-05-12  4:43 UTC (permalink / raw)
  To: monnier; +Cc: help-gnu-emacs

> Sent: Wednesday, May 12, 2021 at 5:26 AM
> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> pietru@caramail.com [2021-05-11 18:43:16] wrote:
> > What do headings start with for texinfo-mode, when using outline-minor-mode?
>
> `texinfo-mode` is one of the rare modes which explicitly sets
> `outline-heading-alist`, so you have the answer in there ;-)

Would it not be better for outline-minor-mode to set "outline-heading-alist"
for each language.  Then, in each language mode, one simply calls the
appropriate function.

>         Stefan
>
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-12  4:43   ` pietru
@ 2021-05-12  5:11   ` pietru
  1 sibling, 0 replies; 20+ messages in thread
From: pietru @ 2021-05-12  5:11 UTC (permalink / raw)
  To: monnier; +Cc: help-gnu-emacs

Could you help me set my own, as I have some additional ones such as
@uchap, @usec, @usubsec, @usubsubsec.

(defvar gilgamesh-texinfo-hdlevels
      '( ("@chapter" . 2)
	 ("@section" . 3)
	 ("@subsection" . 4)
	 ("@subsubsection" . 5)
	 ;; --------------------------------------------------
         ("@unnumbered" . 2)
	 ("@unnumberedsec" . 3)
	 ("@unnumberedsubsec" . 4)
	 ("@unnumberedsubsubsec" . 5)
         ;; --------------------------------------------------
         ("@appendix" . 2)
	 ("@appendixsec" . 3)
         ("@appendixsubsec" . 4)
	 ("@appendixsubsubsec" . 5)
         ;; --------------------------------------------------
	 ("majorheading" 2)
         ;; --------------------------------------------------
	 ("chapheading" 2)
	 ("heading" 3)
	 ("subheading" 4)
	 ("subsubheading" 5)
         ;; --------------------------------------------------
	 ("@uchap" . 2)
	 ("@usec" . 3)
	 ("@usubsec" . 4)
	 ("@usubsubsec" . 5) ))

(setq-local outline-heading-alist
	    ;; We should merge `outline-heading-alist' and
	    ;; `texinfo-section-list'.  But in the mean time, let's
	    ;; just generate one from the other.
	    (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
		    gilgamesh-texinfo-hdlevels))

;;(defun gilgamesh-faddeev-texinfo ()
;;   "todo"
;;   (add-hook 'texinfo-mode-hook #'gilgamesh-texinfo-hdlevels) )

I do not know whether using "add-hook" is the way to do it.

> Sent: Wednesday, May 12, 2021 at 5:26 AM
> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> pietru@caramail.com [2021-05-11 18:43:16] wrote:
> > What do headings start with for texinfo-mode, when using outline-minor-mode?
>
> `texinfo-mode` is one of the rare modes which explicitly sets
> `outline-heading-alist`, so you have the answer in there ;-)
>
>
>         Stefan
>
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12  4:43   ` pietru
@ 2021-05-12 12:34     ` Stefan Monnier
  2021-05-12 12:48       ` pietru
  2021-05-13  3:00       ` Christopher Dimech
  2021-05-12 12:36     ` Jean Louis
  1 sibling, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2021-05-12 12:34 UTC (permalink / raw)
  To: pietru; +Cc: help-gnu-emacs

>> `texinfo-mode` is one of the rare modes which explicitly sets
>> `outline-heading-alist`, so you have the answer in there ;-)
>
> Would it not be better for outline-minor-mode to set "outline-heading-alist"
> for each language.

Better for what?

> Then, in each language mode, one simply calls the
> appropriate function.

Which function?


        Stefan




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12  4:43   ` pietru
  2021-05-12 12:34     ` Stefan Monnier
@ 2021-05-12 12:36     ` Jean Louis
  2021-05-13  2:50       ` Christopher Dimech
  2021-05-13  3:57       ` Christopher Dimech
  1 sibling, 2 replies; 20+ messages in thread
From: Jean Louis @ 2021-05-12 12:36 UTC (permalink / raw)
  To: pietru; +Cc: help-gnu-emacs, monnier

* pietru@caramail.com <pietru@caramail.com> [2021-05-12 07:44]:
> > `texinfo-mode` is one of the rare modes which explicitly sets
> > `outline-heading-alist`, so you have the answer in there ;-)
> 
> Would it not be better for outline-minor-mode to set "outline-heading-alist"
> for each language.  Then, in each language mode, one simply calls the
> appropriate function.


That is the thought I assume each of us has.

There are many modes, various macros, functions. Many modes do not
have its outline structure. Emacs Lisp mode does not have "outline"
defined, we can just virtualize it and think how to create
outline. Its structure would greatly depend of the style, and comments
definition, for example to start writing (defun on the beginning of
the line. Each user can have different comment definition.

Modes which could be used with outline-minor-mode are especially those
with lightweight markup languages and some modes use
outline-minor-mode anyway, so for these it could be done:

adoc-mode and asciidoctor-mode
t2t-mode for txt2tags
markdown-mode 
latex-mode and similar TeX macros, like context-mode

I don't know for plain TeX-plain-tex-mode for example as \beginsection
is just one so far I know. TeX-plain-tex-mode is definitely usable for
reports that don't require elaborate structures. It is way easier to
create report with TeX-plain-tex-mode

Hello there

\beginsection
Here I am

\bye

Whoever now finds good outline-heading-alist post it here, please.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 12:34     ` Stefan Monnier
@ 2021-05-12 12:48       ` pietru
  2021-05-12 14:04         ` Stefan Monnier
  2021-05-13  3:00       ` Christopher Dimech
  1 sibling, 1 reply; 20+ messages in thread
From: pietru @ 2021-05-12 12:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Having outline-minor-mode set outline-heading-alist and outline-regexp form the
different languages (elisp, texinfo).  Then each major mode could use it when
outline-minor-mode is activated.  Currently, each language sets its own.

But it seems to me that outline-minor-mode could do that.  Everything would then
be well contained, rather than spread around the various major-modes.

> Sent: Thursday, May 13, 2021 at 12:34 AM
> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
> To: pietru@caramail.com
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> >> `texinfo-mode` is one of the rare modes which explicitly sets
> >> `outline-heading-alist`, so you have the answer in there ;-)
> >
> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
> > for each language.
>
> Better for what?
>
> > Then, in each language mode, one simply calls the
> > appropriate function.
>
> Which function?
>
>
>         Stefan
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 12:48       ` pietru
@ 2021-05-12 14:04         ` Stefan Monnier
  2021-05-12 14:15           ` pietru
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2021-05-12 14:04 UTC (permalink / raw)
  To: pietru; +Cc: help-gnu-emacs

> Having outline-minor-mode set outline-heading-alist and outline-regexp form the
> different languages (elisp, texinfo).  Then each major mode could use it when
> outline-minor-mode is activated.  Currently, each language sets its own.
> But it seems to me that outline-minor-mode could do that.  Everything would then
> be well contained, rather than spread around the various major-modes.

Send a patch to show how you think it could/should work,


        Stefan


>> Sent: Thursday, May 13, 2021 at 12:34 AM
>> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
>> To: pietru@caramail.com
>> Cc: help-gnu-emacs@gnu.org
>> Subject: Re: headings for texinfo-mode using outline-minor-mode
>>
>> >> `texinfo-mode` is one of the rare modes which explicitly sets
>> >> `outline-heading-alist`, so you have the answer in there ;-)
>> >
>> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
>> > for each language.
>>
>> Better for what?
>>
>> > Then, in each language mode, one simply calls the
>> > appropriate function.
>>
>> Which function?
>>
>>
>>         Stefan
>>
>>




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 14:04         ` Stefan Monnier
@ 2021-05-12 14:15           ` pietru
  0 siblings, 0 replies; 20+ messages in thread
From: pietru @ 2021-05-12 14:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Will need to figure out how to get set outline-heading-alist to work with a new
set of headings.  I am missing something.

This is what I tried, but would need some more assistance to see what else I have to do.

(defvar gilgamesh-texinfo-hdlevels
      '( ("@chapter" . 2)
	 ("@section" . 3)
	 ("@subsection" . 4)
	 ("@subsubsection" . 5)
	 ;; --------------------------------------------------
         ("@unnumbered" . 2)
	 ("@unnumberedsec" . 3)
	 ("@unnumberedsubsec" . 4)
	 ("@unnumberedsubsubsec" . 5)
         ;; --------------------------------------------------
         ("@appendix" . 2)
	 ("@appendixsec" . 3)
         ("@appendixsubsec" . 4)
	 ("@appendixsubsubsec" . 5)
         ;; --------------------------------------------------
	 ("majorheading" 2)
         ;; --------------------------------------------------
	 ("chapheading" 2)
	 ("heading" 3)
	 ("subheading" 4)
	 ("subsubheading" 5)
         ;; --------------------------------------------------
	 ("@uchap" . 2)
	 ("@usec" . 3)
	 ("@usubsec" . 4)
	 ("@usubsubsec" . 5) ))

(setq-local outline-heading-alist
	    (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
		    gilgamesh-texinfo-hdlevels))

;;(defun gilgamesh-faddeev-texinfo ()
;;   "todo"
;;   (add-hook 'texinfo-mode-hook #'gilgamesh-texinfo-hdlevels) )




> Sent: Thursday, May 13, 2021 at 2:04 AM
> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
> To: pietru@caramail.com
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> > Having outline-minor-mode set outline-heading-alist and outline-regexp form the
> > different languages (elisp, texinfo).  Then each major mode could use it when
> > outline-minor-mode is activated.  Currently, each language sets its own.
> > But it seems to me that outline-minor-mode could do that.  Everything would then
> > be well contained, rather than spread around the various major-modes.
>
> Send a patch to show how you think it could/should work,
>
>
>         Stefan
>
>
> >> Sent: Thursday, May 13, 2021 at 12:34 AM
> >> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
> >> To: pietru@caramail.com
> >> Cc: help-gnu-emacs@gnu.org
> >> Subject: Re: headings for texinfo-mode using outline-minor-mode
> >>
> >> >> `texinfo-mode` is one of the rare modes which explicitly sets
> >> >> `outline-heading-alist`, so you have the answer in there ;-)
> >> >
> >> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
> >> > for each language.
> >>
> >> Better for what?
> >>
> >> > Then, in each language mode, one simply calls the
> >> > appropriate function.
> >>
> >> Which function?
> >>
> >>
> >>         Stefan
> >>
> >>
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 12:36     ` Jean Louis
@ 2021-05-13  2:50       ` Christopher Dimech
  2021-05-13  4:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-13  7:20         ` Jean Louis
  2021-05-13  3:57       ` Christopher Dimech
  1 sibling, 2 replies; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  2:50 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, monnier



> Sent: Thursday, May 13, 2021 at 12:36 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: pietru@caramail.com
> Cc: monnier@iro.umontreal.ca, help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> * pietru@caramail.com <pietru@caramail.com> [2021-05-12 07:44]:
> > > `texinfo-mode` is one of the rare modes which explicitly sets
> > > `outline-heading-alist`, so you have the answer in there ;-)
> >
> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
> > for each language.  Then, in each language mode, one simply calls the
> > appropriate function.
>
>
> That is the thought I assume each of us has.
>
> There are many modes, various macros, functions. Many modes do not
> have its outline structure. Emacs Lisp mode does not have "outline"
> defined, we can just virtualize it and think how to create
> outline. Its structure would greatly depend of the style, and comments
> definition, for example to start writing (defun on the beginning of
> the line. Each user can have different comment definition.

Being able to have different comment definition for headings would be very valuable.
I also like the idea that headings become different than code.  This is because, you
could collapse code independently of headers.  Currently code structures are being
used as headers, a strategy which is faulty from my point of view.


> Modes which could be used with outline-minor-mode are especially those
> with lightweight markup languages and some modes use
> outline-minor-mode anyway, so for these it could be done:
>
> adoc-mode and asciidoctor-mode
> t2t-mode for txt2tags
> markdown-mode
> latex-mode and similar TeX macros, like context-mode
>
> I don't know for plain TeX-plain-tex-mode for example as \beginsection
> is just one so far I know. TeX-plain-tex-mode is definitely usable for
> reports that don't require elaborate structures. It is way easier to
> create report with TeX-plain-tex-mode
>
> Hello there
>
> \beginsection
> Here I am
>
> \bye
>
> Whoever now finds good outline-heading-alist post it here, please.

Currently the major problem is in being able to got a good outline-heading-alist
that does the job.  In texinfo.el there is an example on using  outline-heading-alist,
but when I tried doing the same, the headings were not being recognised.


> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>

---------------------
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 12:34     ` Stefan Monnier
  2021-05-12 12:48       ` pietru
@ 2021-05-13  3:00       ` Christopher Dimech
  1 sibling, 0 replies; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  3:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs



> Sent: Thursday, May 13, 2021 at 12:34 AM
> From: "Stefan Monnier" <monnier@iro.umontreal.ca>
> To: pietru@caramail.com
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> >> `texinfo-mode` is one of the rare modes which explicitly sets
> >> `outline-heading-alist`, so you have the answer in there ;-)
> >
> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
> > for each language.
>
> Better for what?
>
> > Then, in each language mode, one simply calls the
> > appropriate function.
>
> Which function?

New specific language functions, e.g. (outline-elisp).  I am working on, except that
I god to be able to set up outline-heading-alist first.

>         Stefan
>
>




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-12 12:36     ` Jean Louis
  2021-05-13  2:50       ` Christopher Dimech
@ 2021-05-13  3:57       ` Christopher Dimech
  1 sibling, 0 replies; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  3:57 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, monnier

Could outline.el be cleaned up a little bit, and see how to make it easier
to set up outline-heading-alist for now.  It already has some good capabilities.


> Sent: Thursday, May 13, 2021 at 12:36 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: pietru@caramail.com
> Cc: monnier@iro.umontreal.ca, help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> * pietru@caramail.com <pietru@caramail.com> [2021-05-12 07:44]:
> > > `texinfo-mode` is one of the rare modes which explicitly sets
> > > `outline-heading-alist`, so you have the answer in there ;-)
> >
> > Would it not be better for outline-minor-mode to set "outline-heading-alist"
> > for each language.  Then, in each language mode, one simply calls the
> > appropriate function.
>
>
> That is the thought I assume each of us has.
>
> There are many modes, various macros, functions. Many modes do not
> have its outline structure. Emacs Lisp mode does not have "outline"
> defined, we can just virtualize it and think how to create
> outline. Its structure would greatly depend of the style, and comments
> definition, for example to start writing (defun on the beginning of
> the line. Each user can have different comment definition.
>
> Modes which could be used with outline-minor-mode are especially those
> with lightweight markup languages and some modes use
> outline-minor-mode anyway, so for these it could be done:
>
> adoc-mode and asciidoctor-mode
> t2t-mode for txt2tags
> markdown-mode
> latex-mode and similar TeX macros, like context-mode
>
> I don't know for plain TeX-plain-tex-mode for example as \beginsection
> is just one so far I know. TeX-plain-tex-mode is definitely usable for
> reports that don't require elaborate structures. It is way easier to
> create report with TeX-plain-tex-mode
>
> Hello there
>
> \beginsection
> Here I am
>
> \bye
>
> Whoever now finds good outline-heading-alist post it here, please.
>
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>

---------------------
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  2:50       ` Christopher Dimech
@ 2021-05-13  4:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-13  4:46           ` Christopher Dimech
  2021-05-13  7:20         ` Jean Louis
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-13  4:28 UTC (permalink / raw)
  To: help-gnu-emacs

> Being able to have different comment definition for headings would be very valuable.
> I also like the idea that headings become different than code.  This is because, you
> could collapse code independently of headers.  Currently code structures are being
> used as headers, a strategy which is faulty from my point of view.

Then you don't want `outline-minor-mode`.  You might like `allout-mode`.


        Stefan




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  4:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-13  4:46           ` Christopher Dimech
  2021-05-13  9:06             ` Robert Thorpe
  0 siblings, 1 reply; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  4:46 UTC (permalink / raw)
  To: monnier; +Cc: help-gnu-emacs

> Sent: Thursday, May 13, 2021 at 4:28 PM
> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> > Being able to have different comment definition for headings would be very valuable.
> > I also like the idea that headings become different than code.  This is because, you
> > could collapse code independently of headers.  Currently code structures are being
> > used as headers, a strategy which is faulty from my point of view.
>
> Then you don't want `outline-minor-mode`.  You might like `allout-mode`.

I am saying to clean up outline-minor-mode and write clear instructions on how
to set up user defined outline-heading-alist.  This is because  outline-minor-mode
has much greater use for code.

>         Stefan
>
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  2:50       ` Christopher Dimech
  2021-05-13  4:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-13  7:20         ` Jean Louis
  2021-05-13  7:36           ` Christopher Dimech
  1 sibling, 1 reply; 20+ messages in thread
From: Jean Louis @ 2021-05-13  7:20 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: help-gnu-emacs, monnier

* Christopher Dimech <dimech@gmx.com> [2021-05-13 05:50]:
> > There are many modes, various macros, functions. Many modes do not
> > have its outline structure. Emacs Lisp mode does not have "outline"
> > defined, we can just virtualize it and think how to create
> > outline. Its structure would greatly depend of the style, and comments
> > definition, for example to start writing (defun on the beginning of
> > the line. Each user can have different comment definition.
> 
> Being able to have different comment definition for headings would be very valuable.
> I also like the idea that headings become different than code.  This is because, you
> could collapse code independently of headers.  Currently code structures are being
> used as headers, a strategy which is faulty from my point of view.

Hmm...

Maybe strategy is not best hypothetically, but practically it is
useful to collapse code structures: I can get the easy overview or
quick index of functions and faster do the movements. Also copy and
paste is easier.

Only "(" in the first column is collaped.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  7:20         ` Jean Louis
@ 2021-05-13  7:36           ` Christopher Dimech
  0 siblings, 0 replies; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  7:36 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, monnier


> Sent: Thursday, May 13, 2021 at 7:20 PM
> From: "Jean Louis" <bugs@gnu.support>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org, monnier@iro.umontreal.ca
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> * Christopher Dimech <dimech@gmx.com> [2021-05-13 05:50]:
> > > There are many modes, various macros, functions. Many modes do not
> > > have its outline structure. Emacs Lisp mode does not have "outline"
> > > defined, we can just virtualize it and think how to create
> > > outline. Its structure would greatly depend of the style, and comments
> > > definition, for example to start writing (defun on the beginning of
> > > the line. Each user can have different comment definition.
> >
> > Being able to have different comment definition for headings would be very valuable.
> > I also like the idea that headings become different than code.  This is because, you
> > could collapse code independently of headers.  Currently code structures are being
> > used as headers, a strategy which is faulty from my point of view.
>
> Hmm...
>
> Maybe strategy is not best hypothetically, but practically it is
> useful to collapse code structures: I can get the easy overview or
> quick index of functions and faster do the movements. Also copy and
> paste is easier.

I absolutely agree that collapse code structures and code structure movements
improves coding practice.  Then with headings you can categorise various sections
of the file that could also be independently manipulated.

At this point, it would first be beneficial to handle the specification of
outline-heading-alist that users could successfully adapt te their needs.

Currently I want to handle texinfo files first because there is already
outline-heading-alist being defined in "texinfo.el".  Then look at elisp.

> Only "(" in the first column is collaped.
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>
>



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  4:46           ` Christopher Dimech
@ 2021-05-13  9:06             ` Robert Thorpe
  2021-05-13  9:39               ` Christopher Dimech
  0 siblings, 1 reply; 20+ messages in thread
From: Robert Thorpe @ 2021-05-13  9:06 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: help-gnu-emacs, monnier

Christopher Dimech <dimech@gmx.com> writes:

>> Sent: Thursday, May 13, 2021 at 4:28 PM
>> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
>> To: help-gnu-emacs@gnu.org
>> Subject: Re: headings for texinfo-mode using outline-minor-mode
>>
>> > Being able to have different comment definition for headings would be very valuable.
>> > I also like the idea that headings become different than code.  This is because, you
>> > could collapse code independently of headers.  Currently code structures are being
>> > used as headers, a strategy which is faulty from my point of view.
>>
>> Then you don't want `outline-minor-mode`.  You might like `allout-mode`.
>
> I am saying to clean up outline-minor-mode and write clear instructions on how
> to set up user defined outline-heading-alist.  This is because  outline-minor-mode
> has much greater use for code.

I disagree.

Outline-mode and outline-minor-mode are simple.  They're made to do
simple and predictable things.  That's the point of them.

We have Org-mode because people want something more than what
outline-mode provides by itself.  We also have things like outshine-mode
and allout-mode because people want more than what outline-mode does by
itself.  But not everybody wants more that's why outline-mode and
outline-minor-mode still exist!

It seems that you are trying to make outline-mode into outshine-mode.
There's no need to do that, we already have outshine-mode.

If you're not doing that, then I don't understand what you are doing.
That's not surprising since so many of your emails are so vague.  You
have to learn to express yourself more clearly as Yuri Khan said.

Also, to write a new mode you have to learn elisp in more depth.  This
project you're doing is a vehicle for doing that certainly.  But
remember that the existing modes I've mentioned were probably written by
people who already knew elisp.

BR,
Robert Thorpe



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

* Re: headings for texinfo-mode using outline-minor-mode
  2021-05-13  9:06             ` Robert Thorpe
@ 2021-05-13  9:39               ` Christopher Dimech
  0 siblings, 0 replies; 20+ messages in thread
From: Christopher Dimech @ 2021-05-13  9:39 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: help-gnu-emacs, monnier


> Sent: Thursday, May 13, 2021 at 9:06 PM
> From: "Robert Thorpe" <rt@robertthorpeconsulting.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org, monnier@iro.umontreal.ca
> Subject: Re: headings for texinfo-mode using outline-minor-mode
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> >> Sent: Thursday, May 13, 2021 at 4:28 PM
> >> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
> >> To: help-gnu-emacs@gnu.org
> >> Subject: Re: headings for texinfo-mode using outline-minor-mode
> >>
> >> > Being able to have different comment definition for headings would be very valuable.
> >> > I also like the idea that headings become different than code.  This is because, you
> >> > could collapse code independently of headers.  Currently code structures are being
> >> > used as headers, a strategy which is faulty from my point of view.
> >>
> >> Then you don't want `outline-minor-mode`.  You might like `allout-mode`.
> >
> > I am saying to clean up outline-minor-mode and write clear instructions on how
> > to set up user defined outline-heading-alist.  This is because  outline-minor-mode
> > has much greater use for code.
>
> I disagree.
>
> Outline-mode and outline-minor-mode are simple.  They're made to do
> simple and predictable things.  That's the point of them.

Would you know how to set up outline-heading-alist for user defined list
for texinfo with post a sample code.  Have not been successful yet.

> We have Org-mode because people want something more than what
> outline-mode provides by itself.  We also have things like outshine-mode
> and allout-mode because people want more than what outline-mode does by
> itself.  But not everybody wants more that's why outline-mode and
> outline-minor-mode still exist!
>
> It seems that you are trying to make outline-mode into outshine-mode.
> There's no need to do that, we already have outshine-mode.

Not currently.  Currently I am trying to set outline-heading-alist and perhaps
improve it a bit.  In the texinfo.el code there are some remarks on improvements.
In addition, there are not many placed where outline-heading-alist is defined.

> If you're not doing that, then I don't understand what you are doing.
> That's not surprising since so many of your emails are so vague.  You
> have to learn to express yourself more clearly as Yuri Khan said.

That would help, yes.

> Also, to write a new mode you have to learn elisp in more depth.  This
> project you're doing is a vehicle for doing that certainly.  But
> remember that the existing modes I've mentioned were probably written by
> people who already knew elisp.

I have done a few minor modes, but I can only do limited things at this point.
Am trying to learn by actually writing some code, but realise my limited set
I tools I am comfortable with.


> BR,
> Robert Thorpe
>
>



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

end of thread, other threads:[~2021-05-13  9:39 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-11 16:43 headings for texinfo-mode using outline-minor-mode pietru
2021-05-11 17:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-12  4:43   ` pietru
2021-05-12 12:34     ` Stefan Monnier
2021-05-12 12:48       ` pietru
2021-05-12 14:04         ` Stefan Monnier
2021-05-12 14:15           ` pietru
2021-05-13  3:00       ` Christopher Dimech
2021-05-12 12:36     ` Jean Louis
2021-05-13  2:50       ` Christopher Dimech
2021-05-13  4:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-13  4:46           ` Christopher Dimech
2021-05-13  9:06             ` Robert Thorpe
2021-05-13  9:39               ` Christopher Dimech
2021-05-13  7:20         ` Jean Louis
2021-05-13  7:36           ` Christopher Dimech
2021-05-13  3:57       ` Christopher Dimech
2021-05-12  5:11   ` pietru
2021-05-12  2:16 ` pietru
2021-05-12  2:39   ` pietru

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.