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

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

Re: headings for texinfo-mode using outline-minor-mode


From: pietru
Subject: Re: headings for texinfo-mode using outline-minor-mode
Date: Wed, 12 May 2021 16:15:09 +0200

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



reply via email to

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