From: Christopher Dimech <dimech@gmx.com>
To: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Setting up user defined texinfo headlines using outline-heading-alist
Date: Thu, 13 May 2021 14:29:25 +0200 [thread overview]
Message-ID: <trinity-1250ce9b-0ca4-4a66-abd9-5f71d0d09d64-1620908965846@3c-app-mailcom-bs03> (raw)
In-Reply-To: <CAP_d_8UyueJ38YN4KmeLMmmC-KmDXeDmGrDsQWN+BkzU-gfLwA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5600 bytes --]
I am running GNU Emacs 27.1 build as x86_64-pc-linux-gnu with GTK+ Version 3.22.30
and cairo version 1.15.10.
I have a texinfo file (test.texi attached) where I defined some additional sectioning
commands (e.g. @usec, @usebsec). I customarily switch on outline-minor-mode to see the
headings. outline-minor-mode gives the possibility to define my own set of headings
(e.g. @usec, @usebsec) by setting up "outline-heading-alist".
With the default settings I get
@node uchapter-amcoh
@unnumbered 6 @ Ameliorating Waveform Coherency...
Have modified my init file with the following code that resets "outline-heading-alist"
to include @usec, @usebsec as headings in addition to @unnumbered
(defvar 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" . 2)
("@usubsec" . 3)
("@usubsubsec" . 4) ))
(setq-local outline-heading-alist texinfo-hdlevels)
I was expecting to see the following
@node uchapter-amcoh
@unnumbered 6 @ Ameliorating Waveform Coherency
@usec @value{seclb} Abductive Reasoning...
@usec @value{seclb} Parsimony over Complexity...
@usubsec @value{seclb} The Claerbout Conjecture...
@usec @value{seclb} Correlograms in Helioseismology...
@usubsec @value{seclb} Solar Magnetic Cycle and the Interface Dynamo...
But I am only seeing
@node uchapter-amcoh
@unnumbered 6 @ Ameliorating Waveform Coherency...
>
> I have a variable ‘texinfo-section-list’ whose value is:
---------------------
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
> 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).
>
[-- Attachment #2: test.texi --]
[-- Type: application/x-texinfo, Size: 4822 bytes --]
next prev parent reply other threads:[~2021-05-13 12:29 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 14:21 outline-heading-alist for elisp using ";; * " Christopher Dimech
2021-05-10 21:08 ` Philip Kaludercic
2021-05-11 1:55 ` Christopher Dimech
2021-05-11 3:00 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-11 5:05 ` Christopher Dimech
2021-05-11 12:06 ` Jean Louis
2021-05-11 12:40 ` Christopher Dimech
2021-05-11 14:17 ` Jean Louis
2021-05-11 12:56 ` Christopher Dimech
2021-05-11 14:20 ` Jean Louis
2021-05-11 15:32 ` Christopher Dimech
2021-05-11 18:09 ` Jean Louis
2021-05-12 1:46 ` Christopher Dimech
2021-05-12 4:00 ` Jean Louis
2021-05-13 3:33 ` Christopher Dimech
2021-05-13 7:22 ` Jean Louis
2021-05-13 7:41 ` Christopher Dimech
2021-05-13 10:03 ` Jean Louis
2021-05-13 10:22 ` Christopher Dimech
2021-05-13 10:33 ` Jean Louis
2021-05-13 11:37 ` Christopher Dimech
2021-05-11 13:15 ` Christopher Dimech
2021-05-11 14:22 ` Jean Louis
2021-05-11 15:22 ` Christopher Dimech
2021-05-12 1:53 ` Christopher Dimech
2021-05-12 12:31 ` Stefan Monnier
2021-05-12 12:43 ` Christopher Dimech
2021-05-12 14:35 ` Yuri Khan
2021-05-12 14:52 ` Christopher Dimech
2021-05-13 12:29 ` Christopher Dimech [this message]
2021-05-13 13:26 ` Setting up user defined texinfo headlines using outline-heading-alist Yuri Khan
2021-05-13 15:10 ` Christopher Dimech
2021-05-13 16:05 ` Yuri Khan
2021-05-13 18:29 ` Jean Louis
2021-05-13 18:48 ` Christopher Dimech
2021-05-13 19:01 ` Yuri Khan
2021-05-13 18:35 ` Christopher Dimech
2021-05-13 19:13 ` Yuri Khan
2021-05-14 3:49 ` Christopher Dimech
2021-05-14 3:56 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-14 5:25 ` Christopher Dimech
2021-05-13 15:34 ` Jean Louis
2021-05-11 2:52 ` outline-heading-alist for elisp using ";; * " Christopher Dimech
2021-05-11 4:50 ` Jean Louis
2021-05-11 5:17 ` Christopher Dimech
2021-05-11 20:54 ` Jeremie Juste
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-1250ce9b-0ca4-4a66-abd9-5f71d0d09d64-1620908965846@3c-app-mailcom-bs03 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).