[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: outline-heading-alist for elisp using ";; * "
From: |
Christopher Dimech |
Subject: |
Re: outline-heading-alist for elisp using ";; * " |
Date: |
Wed, 12 May 2021 16:52:56 +0200 |
Have been picking up on programming mode headings. Basically we are trying to
set up
outline-heading-alist to specify headings in outer-minor-mode. Had started
with emacs-lisp-mode, but now also to texinfo-mode.
You wrote a good description there.
> Sent: Thursday, May 13, 2021 at 2:35 AM
> From: "Yuri Khan" <yuri.v.khan@gmail.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "help-gnu-emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: outline-heading-alist for elisp using ";; * "
>
> On Wed, 12 May 2021 at 19:43, Christopher Dimech <dimech@gmx.com> wrote:
>
> > Some have been trying to set outline-heading-alist fol/lowing the code in
> > "texinfo.el".
> > I have also tried to set it up but have not been successful.
>
> There is a group of people on this list, including you,
> michael-franzese, pietru, steve-humphreys, and wael-zwaiter, who seem
> to be working on a common project, have various difficulties, and post
> requests for assistance that are hard to follow through.
>
> You state an approach (“I have tried this…”), followed by something
> general like “I have not been successful” or “I encountered
> difficulties” or “I need assistance”, but it is not readily clear how
> to assist you. So you get unhelpful answers or no answers at all.
>
> The standard assistance request form includes:
>
> * Your software version(s) and operating system (if you feel it might
> be relevant). This is important because if you are using older
> software, you won’t be able to use some solutions, or people will say
> it just works on newer versions.
> * What high-level problem you are trying to solve. This is important
> because sometimes people will say your approach is wrong and point you
> at a better way to solve it.
> * How you are trying to solve it.
> * What concrete result you expected.
> * What concrete result you observe instead.
>
> Your above request could look like:
>
> ===
> I am on GNU/Linux, running Emacs 27.1.
>
> I have a variable ‘texinfo-section-list’ whose value is:
>
> ((chapter 2) (section 3) (subsection 4) (subsubsection 5)
> (unnumbered 2) (unnumberedsec 3) (unnumberedsubsec 4)
> (unnumberedsubsubsec 5)
> (mychapter 2) (mysection 3) (mysubsection 4))
>
> (note my custom section macros).
>
> I want to set up Emacs so that, when I open a texinfo file,
> outline-minor-mode is enabled and configured to recognize section
> macros listed in ‘texinfo-section-list’ as headings.
>
> To that end, I’m trying this:
>
> (defun my-texinfo-outline ()
> (setq-local outline-heading-alist
> (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
> texinfo-section-list))
> (setq-local outline-regexp
> (concat (regexp-opt (mapcar 'car outline-heading-alist) t)
> "\\>")))
>
> (add-hook 'texinfo-mode-hook #'my-texinfo-outline)
>
> When I open the attached texinfo file, put point on line 42 and press
> C-c @ C-d (outline-hide-subtree), I expect the whole section up to
> line 68 to be hidden but not further lines, because line 69 has a
> custom section header; but Emacs hides everything up to line 86.
> ===
>
> (and don’t forget to actually attach a sample file, as short as
> possible to demonstrate the problem).
>
- Re: outline-heading-alist for elisp using ";; * ", (continued)
- outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/11
- Re: outline-heading-alist for elisp using ";; * ", Jean Louis, 2021/05/11
- outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/11
- Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/11
- Re: outline-heading-alist for elisp using ";; * ", Stefan Monnier, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ", Yuri Khan, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ",
Christopher Dimech <=
- Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Jean Louis, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13